-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #83488 - Aaron1011:ban-expr-inner-attrs, r=petrochenkov
Ban custom inner attributes in expressions and statements Split out from #82608 Custom inner attributes are unstable, so this won't break any stable users. This allows us to speed up token collection, and avoid a redundant call to `collect_tokens_no_attrs` when parsing an `Expr` that has outer attributes. r? `@petrochenkov`
- Loading branch information
Showing
8 changed files
with
257 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
error: expected non-macro inner attribute, found attribute macro `print_target_and_args` | ||
--> $DIR/inner-attrs.rs:27:9 | ||
| | ||
LL | (#![print_target_and_args(fifth)] 1, 2); | ||
| ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute | ||
|
||
error: expected non-macro inner attribute, found attribute macro `print_target_and_args` | ||
--> $DIR/inner-attrs.rs:43:9 | ||
| | ||
LL | [#![print_target_and_args(sixth)] 1 , 2]; | ||
| ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute | ||
|
||
error: expected non-macro inner attribute, found attribute macro `print_target_and_args` | ||
--> $DIR/inner-attrs.rs:45:9 | ||
| | ||
LL | [#![print_target_and_args(seventh)] true ; 5]; | ||
| ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute | ||
|
||
error: expected non-macro inner attribute, found attribute macro `print_target_and_args` | ||
--> $DIR/inner-attrs.rs:49:12 | ||
| | ||
LL | #![print_target_and_args(eighth)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute | ||
|
||
error: expected non-macro inner attribute, found attribute macro `print_target_and_args` | ||
--> $DIR/inner-attrs.rs:54:19 | ||
| | ||
LL | MyStruct { #![print_target_and_args(ninth)] field: true }; | ||
| ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute | ||
|
||
error: aborting due to 5 previous errors | ||
|
Oops, something went wrong.