]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/resolve-error.rs
Stabilize macro_vis_matcher
[rust.git] / src / test / ui-fulldeps / resolve-error.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:derive-foo.rs
12 // aux-build:derive-clona.rs
13 // aux-build:attr_proc_macro.rs
14 // aux-build:bang_proc_macro.rs
15
16 #![feature(custom_attribute)]
17
18 #[macro_use]
19 extern crate derive_foo;
20 #[macro_use]
21 extern crate derive_clona;
22 extern crate attr_proc_macro;
23 extern crate bang_proc_macro;
24
25 use attr_proc_macro::attr_proc_macro;
26 use bang_proc_macro::bang_proc_macro;
27
28 macro_rules! FooWithLongNam {
29     () => {}
30 }
31
32 macro_rules! attr_proc_mac {
33     () => {}
34 }
35
36 #[derive(FooWithLongNan)]
37 //~^ ERROR cannot find
38 struct Foo;
39
40 #[attr_proc_macra] // OK, interpreted as a custom attribute
41 struct Bar;
42
43 #[FooWithLongNan]  // OK, interpreted as a custom attribute
44 struct Asdf;
45
46 #[derive(Dlone)]
47 //~^ ERROR cannot find
48 struct A;
49
50 #[derive(Dlona)]
51 //~^ ERROR cannot find
52 struct B;
53
54 #[derive(attr_proc_macra)]
55 //~^ ERROR cannot find
56 struct C;
57
58 fn main() {
59     FooWithLongNama!();
60     //~^ ERROR cannot find
61
62     attr_proc_macra!();
63     //~^ ERROR cannot find
64
65     Dlona!();
66     //~^ ERROR cannot find
67
68     bang_proc_macrp!();
69     //~^ ERROR cannot find
70 }