aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/name_resolution6.rs
blob: e4087e6281ca97219625aa62103e2f7783096636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" }

pub mod foo {
    pub mod bar {
        pub mod baz {
            pub mod qux {
                #[macro_export]
                macro_rules! foo {
                    (one) => {};
                }

                pub fn foo() {}
            }
        }

        fn f() {
            fn inner() {
                macro_rules! foo {
                    (two) => {};
                }

                foo!(two); // ok, textual scope
                crate::foo!(one); // ok, path res
                super::super::foo!(one); // ok, path res
            }
        }
    }
}