-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix MIR's box
#31286
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
fix MIR's box
#31286
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nagisa (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I had this fixed in my WIP branch f1a72d4 already. I guess it is fine to land this, but this needs a test (feel free steal/cherry-pick it from the linked commit). r=me with a test. |
Previously the code would fail to dereference the temporary.
done |
⌛ Testing commit 9b81d03 with merge d1b48b9... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Fri, Jan 29, 2016 at 8:13 PM, bors [email protected] wrote:
|
⌛ Testing commit 9b81d03 with merge e80958b... |
💔 Test failed - auto-linux-cross-opt |
@bors: retry On Fri, Jan 29, 2016 at 8:58 PM, bors [email protected] wrote:
|
the previous code generated a temporary of the inner type and assigned the box-memory to it. So if you did `let x: Box<usize> = box 5;` you got a ```rust let var0: Box<usize>; // x let mut tmp0: Box<usize>; let mut tmp1: usize; ... tmp1 = Box(usize); (*tmp1) = const 5; tmp0 = tmp1; var0 = tmp0; ``` r? @nagisa
the previous code generated a temporary of the inner type and assigned the box-memory to it. So if you did
let x: Box<usize> = box 5;
you got ar? @nagisa