-
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
[trait constants] thread 'rustc' panicked at 'assertion failed: (left == right)
...'
#70942
Comments
The ICE seems to have been introduced at some point between |
Seems like something went wrong with const eval |
Opsie, that ICE is a safety net that protects us against using constant values at the wrong type (and accidentally transmuting them). Looks like something here isn't aware that there was a type error and goes on using the wrong type for the wrong data. |
@dwrensha do you have a backtrace with line numbers? Curiously, on stable the ICE message is different:
|
So this looks like something is actually running Miri on this ill-typed code, and then doing a MIR assignment where source and target do not have the same size. Since array lengths are involved, I suspect this is similar to rust/src/librustc_mir/interpret/place.rs Lines 932 to 943 in 11f6096
I wonder if there is some way we can not run Miri on MIR like this that is broken beyond repair, to avoid accumulating such hacks? |
With line numbers:
|
Well, on a second look, the error message on that regression is different though, so perhaps that part is fixed, I don’t know, I’ll see where it changes. message on nightly-2019-04-24
Edit: It changes only on the current beta 1.43. |
Hm, however, looking at @Centril's stack trace above, I do quite wonder how we are getting past the |
EDIT: ugh, it doesn't because the body that should've been tainted-by-errors is the associated |
More precisely, the error message changes to (pretty much) the current one in #69181. |
@steffahn thanks, that makes a lot of sense.
Turns out the types on both sides are fine. It's just that the value returned by EDIT: Okay what I was worried about was actually the other call site changed in that PR. |
Fix is up at #70970. |
This is a test |
Error: This issue has already been requested for prioritization. Please let |
I'm seeing an internal compiler error on the following input (found by fuzz-rustc):
The text was updated successfully, but these errors were encountered: