mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +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>
36 lines
888 B
Rust
36 lines
888 B
Rust
//@ revisions: e2015 e2024
|
|
//@[e2015] edition:2015
|
|
//@[e2024] edition:2024
|
|
//@[e2024] compile-flags: -Zunstable-options
|
|
|
|
#![warn(missing_fragment_specifier)]
|
|
|
|
macro_rules! used_arm {
|
|
( $( any_token $field_rust_type )* ) => {};
|
|
//[e2015]~^ ERROR missing fragment
|
|
//[e2015]~| WARN missing fragment
|
|
//[e2015]~| WARN this was previously accepted
|
|
//[e2024]~^^^^ ERROR missing fragment
|
|
//[e2024]~| ERROR missing fragment
|
|
}
|
|
|
|
macro_rules! used_macro_unused_arm {
|
|
() => {};
|
|
( $name ) => {};
|
|
//[e2015]~^ WARN missing fragment
|
|
//[e2015]~| WARN this was previously accepted
|
|
//[e2024]~^^^ ERROR missing fragment
|
|
}
|
|
|
|
macro_rules! unused_macro {
|
|
( $name ) => {};
|
|
//[e2015]~^ WARN missing fragment
|
|
//[e2015]~| WARN this was previously accepted
|
|
//[e2024]~^^^ ERROR missing fragment
|
|
}
|
|
|
|
fn main() {
|
|
used_arm!();
|
|
used_macro_unused_arm!();
|
|
}
|