rust-clippy/tests/ui/deref_addrof_macro.rs
2019-09-03 00:17:23 +09:00

10 lines
191 B
Rust

macro_rules! m {
($($x:tt),*) => { &[$(($x, stringify!(x)),)*] };
}
#[warn(clippy::deref_addrof)]
fn f() -> [(i32, &'static str); 3] {
*m![1, 2, 3] // should be fine
}
fn main() {}