]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/paths-in-macro-invocations.rs
69f8906778a1694875313023aaf40e2896aadb57
[rust.git] / src / test / run-pass / paths-in-macro-invocations.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // aux-build:two_macros.rs
12
13 #![feature(use_extern_macros)]
14
15 extern crate two_macros;
16
17 ::two_macros::macro_one!();
18 two_macros::macro_one!();
19
20 mod foo { pub use two_macros::macro_one as bar; }
21
22 trait T {
23     foo::bar!();
24     ::foo::bar!();
25 }
26
27 struct S {
28     x: foo::bar!(i32),
29     y: ::foo::bar!(i32),
30 }
31
32 impl S {
33     foo::bar!();
34     ::foo::bar!();
35 }
36
37 fn main() {
38     foo::bar!();
39     ::foo::bar!();
40
41     let _ = foo::bar!(0);
42     let _ = ::foo::bar!(0);
43
44     let foo::bar!(_) = 0;
45     let ::foo::bar!(_) = 0;
46 }