Skip to content
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

Rustc scoping regression #40235

Closed
Rupsbant opened this issue Mar 3, 2017 · 8 comments
Closed

Rustc scoping regression #40235

Rupsbant opened this issue Mar 3, 2017 · 8 comments
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Rupsbant
Copy link

Rupsbant commented Mar 3, 2017

The following code does not compile with rustc 1.17.0-nightly (c0b7112ba 2017-03-02). Compiles with stable-x86_64-unknown-linux-gnu unchanged - rustc 1.14.0 (e8a012324 2016-12-16). Testing with updated stable release.

fn n(c: u64) -> u64 {
    c
}
pub fn main() {
    let v = vec![1,2,3];
    let mut it = v.iter();
    while let Some(n) = it.next() {
        println!("{}", n);
    }
    assert!(n(1) == 1);
}
@TimNN TimNN added I-wrong regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 3, 2017
@alexcrichton
Copy link
Member

cc @jseyfried

@TimNN
Copy link
Contributor

TimNN commented Mar 3, 2017

Slightly minified:

fn foo() {}

pub fn main() {
    while let Some(foo) = Some(1) {
        // break; // EDIT: the break is not neccessary
    }
    foo();
}

Introduced between nightly-2017-02-25 and nightly-2017-02-27 (changes).

After skimming the PR's merged during that time I guess this was caused by #39864.

@alexcrichton
Copy link
Member

cc @cramertj

@cramertj
Copy link
Member

cramertj commented Mar 3, 2017

I think the problem is this missing Ribs line (and its corresponding pop). I fixed it locally and am currently testing.

@cramertj
Copy link
Member

cramertj commented Mar 3, 2017

Confirmed the fix and opened #40242.

@cramertj
Copy link
Member

cramertj commented Mar 3, 2017

Somewhat interestingly, there was a successful crater run done on that PR. IIUC, that means that @Rupsbant's PR just happens to be the first time anyone has added code like this to a popular crate.

bors added a commit that referenced this issue Mar 4, 2017
@Rupsbant
Copy link
Author

Rupsbant commented Mar 4, 2017

@cramertj This bug originates from petgraph and was committed 5 months ago: petgraph/petgraph@c85e189. It was tested in the crater run and succeeded.

@bluss
Copy link
Member

bluss commented Mar 6, 2017

Crater doesn't run tests, it only compiles crates. the new cargobomb util addresses that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants