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

Hang in item-bodies checking when dependency contains pub use crate #58430

Closed
dtolnay opened this issue Feb 13, 2019 · 3 comments
Closed

Hang in item-bodies checking when dependency contains pub use crate #58430

dtolnay opened this issue Feb 13, 2019 · 3 comments
Labels
C-bug Category: This is a bug. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dtolnay
Copy link
Member

dtolnay commented Feb 13, 2019

Compiling the following pair of crates hangs and chews up memory.

src/main.rs

fn main() {
    repro_dep::S.f();
}

dep/src/lib.rs

pub use crate as krate;
pub struct S;

Repro script:

#!/bin/bash

cargo new --bin repro
cargo new --lib repro-dep

echo >repro/src/main.rs '
fn main() {
    repro_dep::S.f();
}
'

echo >>repro/Cargo.toml '
repro-dep = { path = "../repro-dep" }
'

echo >repro-dep/src/lib.rs '
pub use crate as krate;
pub struct S;
'

cargo rustc --manifest-path repro/Cargo.toml -- -Ztime-passes

Mentioning @petrochenkov and @nikomatsakis who worked on #45477.
Mentioning @nrc who hit this in a real project.

@dtolnay dtolnay added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. labels Feb 13, 2019
@jonas-schievink
Copy link
Contributor

#57500 is similar, so this might be a duplicate

@petrochenkov
Copy link
Contributor

Same as #55779, most probably.

@dtolnay
Copy link
Member Author

dtolnay commented Feb 13, 2019

Thanks, closing as a duplicate of #57500. #55779 seems somewhat different because it manifests as a compile time stack overflow rather than hang, but it is possible they will be addressed by the same fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. 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

4 participants