1 // This test is similar to `basic.rs`, but nested in modules.
6 #![feature(decl_macro)]
8 #![allow(unused_imports)]
9 #![allow(non_camel_case_types)]
12 // Test that ambiguity errors are not emitted between `self::test` and
13 // `::test`, assuming the latter (crate) is not in `extern_prelude`.
15 pub struct Foo(pub ());
19 // Test that qualified paths can refer to both the external crate and local item.
21 pub struct io(pub ());
23 pub use ::std::io as std_io;
24 pub use self::std::io as local_io;
27 // Test that we can refer to the external crate unqualified
28 // (when there isn't a local item with the same name).
32 // Also test the unqualified external crate import in a nested module,
33 // to show that the above import doesn't resolve through a local `std`
34 // item, e.g., the automatically injected `extern crate std;`, which in
35 // the Rust 2018 should no longer be visible through `crate::std`.
38 // Also test that items named `std` in other namespaces don't
39 // cause ambiguity errors for the import from `std` above.
47 foo::std_io::stdout();
55 // Test that having `io` in a module scope and a non-module
56 // scope is allowed, when both resolve to the same definition.