rust/tests/ui/deref_addrof_macro.rs

11 lines
191 B
Rust
Raw Normal View History

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