mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
25 lines
526 B
Rust
25 lines
526 B
Rust
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() {}
|