Code
I tried this code:
I expected to see this happen: Both check1 and check2 should compile to functions that just use a compiletime-evaluated struct value
Instead, this happened: check1 disapeared from the assembly, and it looks like all the code needed to runtime-evaluate it got added instead
The weird thing is that the function that regressed is the one that uses a const item by name, rather than the one that just calls a const function inside a non-const function body.
Version it worked on
It most recently worked on: 1.74.1 (stable as of writing this)
Version with regression
from playground:
1.76.0-beta.1 (2023-12-21 0e09125c6c3c2fd70d7d)
1.77.0-nightly (2023-12-21 3d0e6bed600c0175628e)
Code
I tried this code:
I expected to see this happen: Both
check1andcheck2should compile to functions that just use a compiletime-evaluated struct valueInstead, this happened:
check1disapeared from the assembly, and it looks like all the code needed to runtime-evaluate it got added insteadThe weird thing is that the function that regressed is the one that uses a
constitem by name, rather than the one that just calls a const function inside a non-const function body.Version it worked on
It most recently worked on: 1.74.1 (stable as of writing this)
Version with regression
from playground: