-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: const eval: expected type differs from actual type.
()
vs i32
#114529
Comments
Backtrace
|
I can't reproduce this on the latest nightly. Can you confirm that this doesn't reproduce anymore? |
This may only be triggerable with a rustc that was built with debug assertions on |
Yes, hence the |
No longer needs debug assertions to crash 🎉 |
|
Edit: Ignore it. Wrong bisection. For some reason it was bisecting to 2023-10-04 on my machine despite the fact that the issue was reported much earlier than this date. |
The issue occurs because the interpreter tries to assign the value Such faulty MIR should not have been generated. However, the while loop, although detected as malformed during AST lowering, successfully typecks. Had it not and had Therefore as far as I understand the solution is to fail typeck and set @rustbot claim |
Rollup merge of rust-lang#117382 - gurry:114529-ice-const-eval, r=oli-obk Fail typeck for illegal break-with-value This is fixes the issue wherein typeck was succeeding for break-with-value exprs at illegal locations such as inside `while`, `while let` and `for` loops which eventually caused an ICE during MIR interpretation for const eval. Now we fail typeck for such code which prevents faulty MIR from being generated and interpreted, thus fixing the ICE. Fixes rust-lang#114529
Code
Meta
rustc --version --verbose
:Error output
The text was updated successfully, but these errors were encountered: