Skip to content

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

Merged
merged 2 commits into from
Jan 30, 2016
Merged

fix MIR's box #31286

merged 2 commits into from
Jan 30, 2016

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 29, 2016

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

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

@rust-highfive
Copy link
Contributor

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.

@nagisa
Copy link
Member

nagisa commented Jan 29, 2016

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.

oli-obk and others added 2 commits January 29, 2016 16:13
Previously the code would fail to dereference the temporary.
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 29, 2016

done

@nagisa
Copy link
Member

nagisa commented Jan 29, 2016

@bors r+ 9b81d03

@bors
Copy link
Collaborator

bors commented Jan 30, 2016

⌛ Testing commit 9b81d03 with merge d1b48b9...

@bors
Copy link
Collaborator

bors commented Jan 30, 2016

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Fri, Jan 29, 2016 at 8:13 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-mac-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/7907


Reply to this email directly or view it on GitHub
#31286 (comment).

@bors
Copy link
Collaborator

bors commented Jan 30, 2016

⌛ Testing commit 9b81d03 with merge e80958b...

@bors
Copy link
Collaborator

bors commented Jan 30, 2016

💔 Test failed - auto-linux-cross-opt

@alexcrichton
Copy link
Member

@bors: retry

On Fri, Jan 29, 2016 at 8:58 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-linux-cross-opt
http://buildbot.rust-lang.org/builders/auto-linux-cross-opt/builds/1065


Reply to this email directly or view it on GitHub
#31286 (comment).

@bors
Copy link
Collaborator

bors commented Jan 30, 2016

⌛ Testing commit 9b81d03 with merge 449e8bf...

bors added a commit that referenced this pull request Jan 30, 2016
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
@bors bors merged commit 9b81d03 into rust-lang:master Jan 30, 2016
@oli-obk oli-obk deleted the fix/mir_box branch February 1, 2016 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants