Skip to content

extern crate privacy is "public" without requiring "pub". #29654

Closed
@eddyb

Description

@eddyb
mod foo {
    extern crate std;
}

fn main() {
    println!("{}", foo::std::mem::size_of::<i32>());
}

Try on playpen.

This is due to is_public being true for all ItemExternCrate regardless of whether they are pub.

Even then, pub extern crate is not handled correctly in all cases, see #26775.

Metadata

Metadata

Assignees

Labels

T-langRelevant to the language team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions