about summary refs log tree commit diff
path: root/tests/ui/attributes/invalid-macro-use.rs
blob: 52e4608303f04cb67a062ba5458f424579f6f560 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#![deny(unused_attributes)]
//~^ NOTE the lint level is defined here

#[macro_use = 5]
//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
extern crate std as s1;

#[macro_use(5)]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE expected a valid identifier here
//~| NOTE for more information, visit
extern crate std as s2;

#[macro_use(a = "b")]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE didn't expect any arguments here
//~| NOTE for more information, visit
extern crate std as s3;

#[macro_use(a(b))]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE didn't expect any arguments here
//~| NOTE for more information, visit
extern crate std as s4;

#[macro_use(a::b)]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE expected a valid identifier here
//~| NOTE for more information, visit
extern crate std as s5;

#[macro_use(a)]
//~^ ERROR unused attribute
#[macro_use]
//~^ NOTE attribute also specified here
extern crate std as s6;

#[macro_use]
//~^ NOTE attribute also specified here
#[macro_use(a)]
//~^ ERROR unused attribute
extern crate std as s7;

#[macro_use]
//~^ NOTE attribute also specified here
#[macro_use]
//~^ ERROR unused attribute
extern crate std as s8;

// This is fine, both are importing different names
#[macro_use(a)]
//~^ ERROR imported macro not found
#[macro_use(b)]
//~^ ERROR imported macro not found
extern crate std as s9;

fn main() {}