Skip to content

Resolve failure with multiple reexports #18083

Closed
@sfackler

Description

@sfackler
mod a {
    use b::{B};
    pub use self::inner::A;

    mod inner {
        pub struct A;
    }
}

mod b {
    use a::{A};
    pub use self::inner::B;

    mod inner {
        pub struct B;
    }
}

fn main() {}
<anon>:11:13: 11:14 error: unresolved import (maybe you meant `A::*`?)
<anon>:11     use a::{A};
                      ^
<anon>:2:13: 2:14 error: unresolved import (maybe you meant `B::*`?)
<anon>:2     use b::{B};
                     ^

If either of the use statements are removed or a pub use is moved above the use, everything builds. It looks like resolve is failing to resolve b::B and a::A in the first round (as it should), but then gives up on the whole module, which prevents the reexport from being processed.

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