mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
deref_addrof_double_trigger: Note why rustfix can't be used
This commit is contained in:
parent
fa969762a4
commit
d513a0b0a1
@ -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;
|
||||
|
||||
|
@ -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`
|
||||
|
Loading…
Reference in New Issue
Block a user