-
Notifications
You must be signed in to change notification settings - Fork 13.3k
MIR inlining doesn't work together with MIR validation #46086
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
This is just a bug in the inliner, as far as I can tell. It was mapping arguments to lvalues like |
Hmm, StorageDead is not very convincing. It may be that we could actually handle those paths without spilling. Let me poke a bit more. |
OK, so, I'm a bit torn. On the one hand, I think we could get away without "unpacking" the tuple into locals. On the other hand, this code could be much cleaner if just do the unpacking (and then do some other simplifications). |
Ah, ok, I now at least know how to characterize the failure. It occurs when an argument is referenced but not through an operand (such as in a borrow). In that case, the "rewriter" would fall through to |
Well, I ran out of time, so I pushed an "adequate" fix to #45879. This is neither the "better fix" (which I also have locally, actually) that avoids spilling locals and directly references |
The relevant miri issue is rust-lang/miri#331 |
@oli-obk that's a very different issue. If I understand this one here, the problem is that AFAIK What @oli-obk mentions should not lead to ICEs, but it means that miri cannot meaningfully run with both validation and inlining turned on. |
|
Ah, so the problem is that it takes an |
This appears to be fixed as of at least the most recent nightly.
|
@RalfJung do we even care about validation being correct atm? The crash is gone, but that might just mean validation statements got removed |
Well... I somewhat care. But validation is indeed broken currently. Also, AFAIK @eddyb (or someone else) changed the |
STR
tested on commit 1410d56 on x86_64-unknown-linux-gnu
Expected result
Code compiles
Actual result
ICE - I think the problem is that
Validate
is restricted to taking a local as an argument, which we can't expand to a closure upvar.I suppose for now a solution could be to remove the offending
Validate
statements - I suppose MIRI always runs with MIR optimizations off. cc @RalfJungThe text was updated successfully, but these errors were encountered: