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
Auto merge of #39812 - larsluthman:const-eval-bugfix, r=nrc
Fix type hint bug in eval_const_expr_partial() (issue #39548)
When evaluating const expressions for things like array lengths, rustc assumes that the operands in comparison expressions (a < b, a == b, a >= b etc) are booleans and sets their type hints accordingly, causing an incorrect compilation error in the case "(FOO < 4)" with "const FOO: i32 = 3" and a compiler panic in the case "(3 < 4)".
This fix makes sure that rustc does not assume anything about the types of those operands.
0 commit comments