]> git.lizzy.rs Git - rust.git/blob - src/test/ui/extern/extern-crate-visibility.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / extern / extern-crate-visibility.rs
1 mod foo {
2     extern crate core;
3 }
4
5 // Check that private crates can be used from outside their modules, albeit with warnings
6 use foo::core::cell; //~ ERROR crate import `core` is private
7
8 fn f() {
9     foo::core::cell::Cell::new(0); //~ ERROR crate import `core` is private
10
11     use foo::*;
12     mod core {} // Check that private crates are not glob imported
13 }
14
15 mod bar {
16     pub extern crate core;
17 }
18
19 mod baz {
20     pub use bar::*;
21     use self::core::cell; // Check that public extern crates are glob imported
22 }
23
24 fn main() {}