You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0080]: evaluation of constant value failed
--> <source>:4:9
|
4 | X = (1 << 500),
| ^^^^^^^^^^ attempt to shift left by `500_i32`, which would overflow
error[E0080]: evaluation of constant value failed
--> <source>:5:9
|
5 | Y = (1 / 0),
| ^^^^^^^ attempt to divide `1_isize` by zero
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.Compiler returned:1
Instead, this happened:
Compiled Successfully.
This is the output of gccrs:
Compiler returned:0
Meta
What version of Rust GCC were you using, git sha b9566fd.
We are not doing const-eval on the enum discriminant values during compilation of the type
GCC is not doing overflow checking on shift expression see: fold_convert_loc is simply folding the value and not marking TREE_OVERFLOW
We should probably be calling build2 instead of fold_build2 when inside a const context to get the constexpr code to do the overflow checking for us might fix this
We actually need to port over code from c/c-fold.cc to get support for detecting this case the default GCC middle end does not set TREE_OVERFLOW for us.
Side note, when looking at the precise version from Compiler-Explorer for nightly compilers, do NOT use the tooltip at the bottom. These are pre-computed offline and will not be updated along with the compiler every night. It only gets updated when we release a new version of compiler explorer (can be several times a week, sometimes more, sometimes less...).
If you need the exact version, use --version, or check the extra information in the assembly.
Failed to evaluate constant value
E0080
compiler-explorer
I tried this code from
E0080
:I expected to see this happen:
evaluation of constant value failed
Instead, this happened:
Meta
The text was updated successfully, but these errors were encountered: