Skip to content

Shadowed name possibly not resolved cross-crate #12661

@alexcrichton

Description

@alexcrichton
// foo.rs
#[crate_type = "lib"];

pub use foo::Primitive;

mod foo {
    pub struct Primitive;
}
// bar.rs
extern crate foo;

fn main() {
    foo::Primitive;
}
$ rustc foo.rs && rustc bar.rs -L.                                                 
foo.rs:6:5: 6:26 warning: code is never used: `Primitive`, #[warn(dead_code)] on by default
foo.rs:6     pub struct Primitive;
             ^~~~~~~~~~~~~~~~~~~~~
bar.rs:4:5: 4:19 error: unresolved name `foo::Primitive`.
bar.rs:4     foo::Primitive;
             ^~~~~~~~~~~~~~
error: aborting due to previous error

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