]> git.lizzy.rs Git - rust.git/blob - src/test/ui/attrs-resolution-errors.rs
Auto merge of #78864 - Mark-Simulacrum:warn-on-forbids, r=pnkfelix
[rust.git] / src / test / ui / attrs-resolution-errors.rs
1 enum FooEnum {
2     #[test]
3     //~^ ERROR expected non-macro attribute, found attribute macro
4     Bar(i32),
5 }
6
7 struct FooStruct {
8     #[test]
9     //~^ ERROR expected non-macro attribute, found attribute macro
10     bar: i32,
11 }
12
13 fn main() {
14     let foo_enum_bar = FooEnum::Bar(1);
15     match foo_enum_bar {
16         FooEnum::Bar(x) => {},
17         _ => {}
18     }
19
20     let foo_struct = FooStruct { bar: 1 };
21     match foo_struct {
22         FooStruct {
23             #[test] bar
24             //~^ ERROR expected non-macro attribute, found attribute macro
25         } => {}
26     }
27
28     match 1 {
29         0 => {}
30         #[test]
31         //~^ ERROR expected non-macro attribute, found attribute macro
32         _ => {}
33     }
34
35     let _another_foo_strunct = FooStruct {
36         #[test]
37         //~^ ERROR expected non-macro attribute, found attribute macro
38         bar: 1,
39     };
40 }