Skip to content

Resolve leaves import resolutions in an inconsistent state #31403

Closed
@jseyfried

Description

@jseyfried

For example,

mod foo {
    pub mod bar {} // This defines bar in the type namespace
    pub use alpha::bar; // This defines bar in the value namespace

    // This should define baz in both namespaces, but it only defines `baz` in the type namespace.
    pub use self::bar as baz;
    pub fn baz() {} // This should collide with the imported `baz`, but now it does not.
}

pub fn f() {}
mod alpha {
    pub use self::f as bar; // Changing this to `pub fn bar() {}` makes the imports consistent
    pub use super::*;
}

fn main() {
    foo::bar();
    foo::baz(); // This errors
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions