rust/tests/ui/extern/extern-crate-visibility.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
526 B
Rust
Raw Normal View History

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
}
2016-04-09 02:31:03 +00:00
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() {}