deref_addrof_double_trigger: Note why rustfix can't be used

This commit is contained in:
Manish Goregaokar 2019-09-20 06:57:15 +09:00
parent fa969762a4
commit d513a0b0a1
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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`