rust/tests/ui/deref_addrof_macro.rs

11 lines
191 B
Rust
Raw Normal View History

2019-09-02 16:26:04 +02:00
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() {}