-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE when non-const in const path. #28172
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
Comments
I managed to reproduce this bug, and found it can be avoided by making |
It looks like rust throws an ICE when it can't compare values in a range, here: ...
match const_eval::compare_lit_exprs(self.tcx, start, end) {
Some(Ordering::Less) |
Some(Ordering::Equal) => {}
Some(Ordering::Greater) => {
span_err!(self.tcx.sess, start.span, E0030,
"lower range bound must be less than or equal to upper");
}
None => {
self.tcx.sess.span_bug(
start.span, "literals of different types in range pat");
}
}
... Edit: This is in librustc/middle/check_const.rs, lines 372-383 |
Maybe |
An error message is already issued. It should just ignore it. |
@arielb1 I'm not sure what you mean. It looks to me like |
Right, but |
Ok i get it! |
It turns out that the error is already caught in |
this doesn't ice anymore |
This is that backtrace and error.
This is the code that caused it.
rustc version
The text was updated successfully, but these errors were encountered: