forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#83312 - petrochenkov:noinner, r=Aaron1011
parser: Remove support for inner attributes on non-block expressions Remove support for attributes like ```rust fn attrs() { (#![print_target_and_args(fifth)] 1, 2); [#![print_target_and_args(sixth)] 1 , 2]; [#![print_target_and_args(seventh)] true ; 5]; match 0 { #![print_target_and_args(eighth)] _ => {} } MyStruct { #![print_target_and_args(ninth)] field: true }; } ``` They are - useless - unstable (modulo holes like rust-lang#65860) - pessimize compiler performance, namely token collection for macros (cc rust-lang#82608) I still want to run crater on this to check whether the stability holes are exploited in practice, and whether such attributes are used at all.
- Loading branch information
Showing
13 changed files
with
316 additions
and
637 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
error: variable `X` should have a snake case name | ||
--> $DIR/expr_attr_paren_order.rs:19:17 | ||
--> $DIR/expr_attr_paren_order.rs:17:17 | ||
| | ||
LL | let X = 0; | ||
| ^ help: convert the identifier to snake case (notice the capitalization): `x` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/expr_attr_paren_order.rs:17:17 | ||
--> $DIR/expr_attr_paren_order.rs:15:37 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
LL | #[allow(non_snake_case)] #[deny(non_snake_case)] ( | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.