File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 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+
110enum FooEnum {
211 #[ test]
312 //~^ ERROR expected non-macro attribute, found attribute macro
@@ -32,7 +41,7 @@ fn main() {
3241 _ => { }
3342 }
3443
35- let _another_foo_strunct = FooStruct {
44+ let _another_foo_struct = FooStruct {
3645 #[ test]
3746 //~^ ERROR expected non-macro attribute, found attribute macro
3847 bar : 1 ,
Original file line number Diff line number Diff line change 11error: 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
33 |
44LL | #[test]
55 | ^^^^ not a non-macro attribute
66
77error: 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
99 |
1010LL | #[test]
1111 | ^^^^ not a non-macro attribute
1212
1313error: 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
1515 |
1616LL | #[test] bar
1717 | ^^^^ not a non-macro attribute
1818
1919error: 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
2121 |
2222LL | #[test]
2323 | ^^^^ not a non-macro attribute
2424
2525error: 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
2727 |
2828LL | #[test]
2929 | ^^^^ not a non-macro attribute
You can’t perform that action at this time.
0 commit comments