forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
missing_fragment_specifier
an error in edition 2024
`missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout. Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`. Fixes <rust-lang#40107>
- Loading branch information
Showing
7 changed files
with
114 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:9:20 | ||
| | ||
LL | ( $( any_token $field_rust_type )* ) => {}; | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: fragment specifiers must be specified in the 2024 edition | ||
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` | ||
help: try adding a specifier here | ||
| | ||
LL | ( $( any_token $field_rust_type:spec )* ) => {}; | ||
| +++++ | ||
|
||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:19:7 | ||
| | ||
LL | ( $name ) => {}; | ||
| ^^^^^ | ||
| | ||
= note: fragment specifiers must be specified in the 2024 edition | ||
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` | ||
help: try adding a specifier here | ||
| | ||
LL | ( $name:spec ) => {}; | ||
| +++++ | ||
|
||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:26:7 | ||
| | ||
LL | ( $name ) => {}; | ||
| ^^^^^ | ||
| | ||
= note: fragment specifiers must be specified in the 2024 edition | ||
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` | ||
help: try adding a specifier here | ||
| | ||
LL | ( $name:spec ) => {}; | ||
| +++++ | ||
|
||
error: missing fragment specifier | ||
--> $DIR/macro-missing-fragment.rs:9:20 | ||
| | ||
LL | ( $( any_token $field_rust_type )* ) => {}; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
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