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

Comments

Projects
None yet
5 participants
@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);
}
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 3, 2017

@TimNN

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 3, 2017

@cramertj

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

cramertj commented Mar 3, 2017

Confirmed the fix and opened #40242.

@cramertj

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

Rupsbant commented Mar 4, 2017

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

@bors bors closed this in #40242 Mar 4, 2017

@bluss bluss referenced this issue Mar 6, 2017

Merged

AllEdges additions #129

@bluss

This comment has been minimized.

Copy link
Contributor

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
You can’t perform that action at this time.