2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2019-03-21 15:36:50 -05:00
|
|
|
// compile-flags:--extern extern_prelude --extern Vec
|
|
|
|
// aux-build:extern-prelude.rs
|
|
|
|
// aux-build:extern-prelude-vec.rs
|
|
|
|
|
|
|
|
fn basic() {
|
|
|
|
// It works
|
|
|
|
let s = extern_prelude::S;
|
|
|
|
s.external();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn shadow_mod() {
|
|
|
|
// Local module shadows `extern_prelude` from extern prelude
|
|
|
|
mod extern_prelude {
|
|
|
|
pub struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
pub fn internal(&self) {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let s = extern_prelude::S;
|
|
|
|
s.internal(); // OK
|
|
|
|
}
|
|
|
|
|
|
|
|
fn shadow_prelude() {
|
|
|
|
// Extern prelude shadows standard library prelude
|
2023-06-12 03:55:36 -05:00
|
|
|
let x: () = Vec::new(0f32, ()); // OK
|
2019-03-21 15:36:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|