mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
8c402f125c
`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 <https://github.com/rust-lang/rust/issues/40107>
48 lines
1.6 KiB
Plaintext
48 lines
1.6 KiB
Plaintext
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
|
|
|