]> git.lizzy.rs Git - rust.git/blob - src/test/ui/imports/local-modularized-tricky-fail-1.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / imports / local-modularized-tricky-fail-1.rs
1 // Copyright 2018 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 #![feature(decl_macro)]
12
13 macro_rules! define_exported { () => {
14     #[macro_export]
15     macro_rules! exported {
16         () => ()
17     }
18 }}
19 macro_rules! define_panic { () => {
20     #[macro_export]
21     macro_rules! panic {
22         () => ()
23     }
24 }}
25 macro_rules! define_include { () => {
26     #[macro_export]
27     macro_rules! include {
28         () => ()
29     }
30 }}
31
32 use inner1::*;
33
34 mod inner1 {
35     pub macro exported() {}
36 }
37
38 exported!(); //~ ERROR `exported` is ambiguous
39
40 mod inner2 {
41     define_exported!();
42 }
43
44 fn main() {
45     panic!(); //~ ERROR `panic` is ambiguous
46 }
47
48 mod inner3 {
49     define_panic!();
50 }
51
52 mod inner4 {
53     define_include!();
54 }
55
56 include!(); //~ ERROR `include` is ambiguous