diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/deref_addrof_macro.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/deref_addrof_macro.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/deref_addrof_macro.rs b/src/tools/clippy/tests/ui/deref_addrof_macro.rs new file mode 100644 index 000000000..dcebd6c6e --- /dev/null +++ b/src/tools/clippy/tests/ui/deref_addrof_macro.rs @@ -0,0 +1,10 @@ +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() {} |