Skip to content

Rustc hangs indefinitely when a dependent crate recursively exports one of its modules #33776

Closed
@koute

Description

@koute

If you do this in a lib.rs in crate a:

pub mod module;

and then you do this in a module.rs in the same crate:

pub use module;

and then you use the crate a in a crate b then rustc will hang indefinitely during the compilation.

Steps to reproduce

cargo new a
cargo new --bin b

echo 'pub mod module;' > a/src/lib.rs
echo 'pub use module;' > a/src/module.rs

echo '[dependencies.a]' >> b/Cargo.toml
echo 'path = "../a"' >> b/Cargo.toml
echo 'extern crate a;' >> b/src/main.rs
echo 'struct Instance { x: a::A }' >> b/src/main.rs

cd b
cargo build

Meta

rustc 1.10.0-nightly (179539f 2016-05-20)
host: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions