]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/uniform-paths/macros.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / uniform-paths / macros.rs
CommitLineData
69743fb6 1// This test is similar to `basic.rs`, but with macros defining local items.
b7449926
XL
2
3// run-pass
b7449926
XL
4// edition:2018
5
69743fb6 6#![allow(non_camel_case_types)]
b7449926
XL
7
8// Test that ambiguity errors are not emitted between `self::test` and
9// `::test`, assuming the latter (crate) is not in `extern_prelude`.
10macro_rules! m1 {
11 () => {
12 mod test {
13 pub struct Foo(pub ());
14 }
15 }
16}
17use test::Foo;
18m1!();
19
20// Test that qualified paths can refer to both the external crate and local item.
21macro_rules! m2 {
22 () => {
23 mod std {
24 pub struct io(pub ());
25 }
26 }
27}
28use ::std::io as std_io;
29use self::std::io as local_io;
30m2!();
31
32fn main() {
33 Foo(());
34 std_io::stdout();
35 local_io(());
36}