-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: -Zvalidate-mir: broken mir in libcore #73109
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hm... @jonas-schievink suggested to also accept |
I'm having a look at this - if it gets too rough I'll be sure to release @rustbot claim |
FYI: I think the solution outlined in https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master/near/200033437 is better than just accepting |
|
FWIW, here's the Miri code that would ICE for a
I think Miri runs shims as well, so... not sure what happens here. |
But, the thing is, |
I've checked this locally and |
Miri has a subst that monomorphizes everything, yes. |
That's my current hypothesis, but I haven't verified it yet |
That was how I was thinking about it when I wrote the trait bounds check - although I'm really just getting to grips with MIR so it was just an idea (albeit - I thought it was a different piece of MIR that was generic) |
In that case though - isn't a trait bounds check enough given a flag for the MIR validator to disable it when we expect non-generic MIR? |
Maybe... I guess the question is, right now we don't see this happen outside the shims; should we make sure it stays that way? |
Ok as far as I can tell #69925 is the problem. MIR shims get substitutions in two places: one phase computes the signature and the other resolves types in the body for mono-morphisation. To avoid double-substitutions @eddyb added some papering that asserts that signatures for I'm having a look to see if I can alter the shim code to make use of the concretised version as this would resolve our problems and remove the need for #73175. |
Didn't work :(( I start getting lots of panics (example attached). I have no idea why this would be the case though... Here's my branch - https://github.com/doctorn/rust/tree/mir-shim-validation. Backtrace
|
I've managed to fix the shim creation to avoid Not sure that's the best approach, but it seems to work. |
Uh oh!
There was an error while loading. Please reload this page.
Code
Meta
rustc --version --verbose
:repo @ 0262de5
Error output
build/x86_64-unknown-linux-gnu/stage2/bin/rustc bad.rs -Zvalidate-mir
Backtrace
This issue has been assigned to @doctorn via this comment.
The text was updated successfully, but these errors were encountered: