File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change
1
+ //! Check that certain positions (listed below) only permit *non-macro* attributes and reject
2
+ //! attribute macros:
3
+ //!
4
+ //! - Enum variants
5
+ //! - Struct fields
6
+ //! - Field in a struct pattern
7
+ //! - Match arm
8
+ //! - Field in struct initialization expression
9
+
1
10
enum FooEnum {
2
11
#[ test]
3
12
//~^ ERROR expected non-macro attribute, found attribute macro
@@ -32,7 +41,7 @@ fn main() {
32
41
_ => { }
33
42
}
34
43
35
- let _another_foo_strunct = FooStruct {
44
+ let _another_foo_struct = FooStruct {
36
45
#[ test]
37
46
//~^ ERROR expected non-macro attribute, found attribute macro
38
47
bar : 1 ,
Original file line number Diff line number Diff line change 1
1
error: expected non-macro attribute, found attribute macro `test`
2
- --> $DIR/attrs-resolution-errors .rs:2 :7
2
+ --> $DIR/attr-macros-positional-rejection .rs:11 :7
3
3
|
4
4
LL | #[test]
5
5
| ^^^^ not a non-macro attribute
6
6
7
7
error: expected non-macro attribute, found attribute macro `test`
8
- --> $DIR/attrs-resolution-errors .rs:8 :7
8
+ --> $DIR/attr-macros-positional-rejection .rs:17 :7
9
9
|
10
10
LL | #[test]
11
11
| ^^^^ not a non-macro attribute
12
12
13
13
error: expected non-macro attribute, found attribute macro `test`
14
- --> $DIR/attrs-resolution-errors .rs:23 :15
14
+ --> $DIR/attr-macros-positional-rejection .rs:32 :15
15
15
|
16
16
LL | #[test] bar
17
17
| ^^^^ not a non-macro attribute
18
18
19
19
error: expected non-macro attribute, found attribute macro `test`
20
- --> $DIR/attrs-resolution-errors .rs:30 :11
20
+ --> $DIR/attr-macros-positional-rejection .rs:39 :11
21
21
|
22
22
LL | #[test]
23
23
| ^^^^ not a non-macro attribute
24
24
25
25
error: expected non-macro attribute, found attribute macro `test`
26
- --> $DIR/attrs-resolution-errors .rs:36 :11
26
+ --> $DIR/attr-macros-positional-rejection .rs:45 :11
27
27
|
28
28
LL | #[test]
29
29
| ^^^^ not a non-macro attribute
You can’t perform that action at this time.
0 commit comments