mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
16 lines
278 B
Rust
16 lines
278 B
Rust
//@ check-pass
|
|
//@ edition: 2015
|
|
//@ reference: macro.decl.meta.edition2024
|
|
|
|
// Ensures expr_2021 fragment specifier is accepted in old editions
|
|
|
|
macro_rules! my_macro {
|
|
($x:expr_2021) => {
|
|
println!("Hello, {}!", $x);
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
my_macro!("world");
|
|
}
|