]> git.lizzy.rs Git - rust.git/blob - src/test/ui/uniform-paths/basic.rs
Auto merge of #93718 - thomcc:used-macho, r=pnkfelix
[rust.git] / src / test / ui / uniform-paths / basic.rs
1 // run-pass
2 // edition:2018
3
4 #![allow(unused_imports)]
5 #![allow(non_camel_case_types)]
6
7 // Test that ambiguity errors are not emitted between `self::test` and
8 // `::test`, assuming the latter (crate) is not in `extern_prelude`.
9 mod test {
10     pub struct Foo(pub ());
11 }
12 use test::Foo;
13
14 // Test that qualified paths can refer to both the external crate and local item.
15 mod std {
16     pub struct io(pub ());
17 }
18 use ::std::io as std_io;
19 use self::std::io as local_io;
20
21 fn main() {
22     Foo(());
23     let _ = std_io::stdout();
24     local_io(());
25
26     {
27         // Test that having `std_io` in a module scope and a non-module
28         // scope is allowed, when both resolve to the same definition.
29         use ::std::io as std_io;
30         use std_io::stdout;
31         let _ = stdout();
32     }
33 }