Skip to content

Conversation

sinkuu
Copy link
Contributor

@sinkuu sinkuu commented Dec 3, 2017

Remaining part of MIR copyprop regression by (I think) #45380, which I missed in #45753.

fn foo(mut x: i32) -> i32 {
    let y = x;
    x = 123; // `x` is assigned only once in MIR, but cannot be propagated to `y`
    y
}

So any assignment to an argument cannot be propagated.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@arielb1
Copy link
Contributor

arielb1 commented Dec 3, 2017

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 3, 2017

📌 Commit 17d6631 has been approved by arielb1

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 3, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Dec 3, 2017
Fix CopyPropagation regression (2)

Remaining part of MIR copyprop regression by (I think) rust-lang#45380, which I missed in rust-lang#45753.

```rust
fn foo(mut x: i32) -> i32 {
    let y = x;
    x = 123; // `x` is assigned only once in MIR, but cannot be propagated to `y`
    y
}
```

So any assignment to an argument cannot be propagated.
bors added a commit that referenced this pull request Dec 3, 2017
Rollup of 8 pull requests

- Successful merges: #45957, #46260, #46432, #46442, #46454, #46462, #46465, #46473
- Failed merges:
@bors bors merged commit 17d6631 into rust-lang:master Dec 4, 2017
@sinkuu sinkuu deleted the copyprop_reg2 branch December 4, 2017 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants