summaryrefslogtreecommitdiffstats
path: root/src/test/ui/extern/extern-crate-visibility.rs
blob: cda1227cc8e924e0210eff954ca5299a261813ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod foo {
    extern crate core;
}

// Check that private crates can be used from outside their modules, albeit with warnings
use foo::core::cell; //~ ERROR crate import `core` is private

fn f() {
    foo::core::cell::Cell::new(0); //~ ERROR crate import `core` is private

    use foo::*;
    mod core {} // Check that private crates are not glob imported
}

mod bar {
    pub extern crate core;
}

mod baz {
    pub use bar::*;
    use self::core::cell; // Check that public extern crates are glob imported
}

fn main() {}