rust/tests/ui/fmt/format-args-capture-macro-hygiene-pass.rs
2024-02-16 20:02:50 +00:00

17 lines
247 B
Rust

//@ run-pass
macro_rules! format_mbe {
($tt:tt) => {
{
#[allow(unused_variables)]
let a = 123;
format!($tt)
}
};
}
fn main() {
let a = 0;
assert_eq!(format_mbe!("{a}"), "0");
}