mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

Since [1], the fragment specifier is unconditionally required in all editions. This means `NonTerminalKind` no longer needs to be optional, as we can reject this code during the expansion of `macro_rules!` rather than handling it throughout the code. Do this cleanup here. [1]: https://github.com/rust-lang/rust/pull/128425
20 lines
421 B
Rust
20 lines
421 B
Rust
//! Ensure that macros produce an error if fragment specifiers are missing.
|
|
|
|
macro_rules! used_arm {
|
|
( $( any_token $field_rust_type )* ) => {}; //~ ERROR missing fragment
|
|
}
|
|
|
|
macro_rules! used_macro_unused_arm {
|
|
() => {};
|
|
( $name ) => {}; //~ ERROR missing fragment
|
|
}
|
|
|
|
macro_rules! unused_macro {
|
|
( $name ) => {}; //~ ERROR missing fragment
|
|
}
|
|
|
|
fn main() {
|
|
used_arm!();
|
|
used_macro_unused_arm!();
|
|
}
|