From d513a0b0a157ea2503e3b226440a835403cb0100 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 20 Sep 2019 06:57:15 +0900 Subject: [PATCH] deref_addrof_double_trigger: Note why rustfix can't be used --- tests/ui/deref_addrof_double_trigger.rs | 4 +++- tests/ui/deref_addrof_double_trigger.stderr | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/ui/deref_addrof_double_trigger.rs b/tests/ui/deref_addrof_double_trigger.rs index e19af5b9087..4531943299c 100644 --- a/tests/ui/deref_addrof_double_trigger.rs +++ b/tests/ui/deref_addrof_double_trigger.rs @@ -1,5 +1,7 @@ +// This test can't work with run-rustfix because it needs two passes of test+fix + #[warn(clippy::deref_addrof)] -#[allow(unused_variables)] +#[allow(unused_variables, unused_mut)] fn main() { let a = 10; diff --git a/tests/ui/deref_addrof_double_trigger.stderr b/tests/ui/deref_addrof_double_trigger.stderr index 89284e1a8ed..2c55a4ed6ac 100644 --- a/tests/ui/deref_addrof_double_trigger.stderr +++ b/tests/ui/deref_addrof_double_trigger.stderr @@ -1,5 +1,5 @@ error: immediately dereferencing a reference - --> $DIR/deref_addrof_double_trigger.rs:8:14 + --> $DIR/deref_addrof_double_trigger.rs:10:14 | LL | let b = **&&a; | ^^^^ help: try this: `&a` @@ -7,13 +7,13 @@ LL | let b = **&&a; = note: `-D clippy::deref-addrof` implied by `-D warnings` error: immediately dereferencing a reference - --> $DIR/deref_addrof_double_trigger.rs:12:17 + --> $DIR/deref_addrof_double_trigger.rs:14:17 | LL | let y = *&mut x; | ^^^^^^^ help: try this: `x` error: immediately dereferencing a reference - --> $DIR/deref_addrof_double_trigger.rs:19:18 + --> $DIR/deref_addrof_double_trigger.rs:21:18 | LL | let y = **&mut &mut x; | ^^^^^^^^^^^^ help: try this: `&mut x`