-
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
MIR drop order is sometimes odd #32433
Comments
I’m certainly surprised we do not drop things in reverse order for the 2nd test case. Once we “fix” that, the first issue should fix itself too. |
Better tests (comment out |
Another interesting difference: foo(&foo(&Foo(0), 1), 2); prints: while &foo(&foo(&Foo(0), 1), 2); prints: (both of the above print |
@pnkfelix I think that's some statement handling, i.e. the outermost |
mir: drop temps outside-in by scheduling the drops inside-out. It was backwards all along, but only noticeable with multiple drops in one rvalue scope. Fixes rust-lang#32433.
Here's my latest testcase: https://play.rust-lang.org/?gist=7da9d41eee66dabeeaa62454f885da6b&version=nightly&backtrace=0 The problem appears to be that the short-lived
That means HAIR is telling The Whoopty doo. Days since last soundness bug: 0 (#33490) |
mir: drop temps outside-in by scheduling the drops inside-out. It was backwards all along, but only noticeable with multiple drops in one rvalue scope. Fixes #32433.
As @eddyb noted on IRC:
Related test:
src/test/run-pass/issue-23338-ensure-param-drop-order.rs
The text was updated successfully, but these errors were encountered: