2019-09-19 21:57:15 +00:00
|
|
|
// This test can't work with run-rustfix because it needs two passes of test+fix
|
|
|
|
|
2019-04-16 18:26:55 +00:00
|
|
|
#[warn(clippy::deref_addrof)]
|
2019-09-19 21:57:15 +00:00
|
|
|
#[allow(unused_variables, unused_mut)]
|
2019-04-16 18:26:55 +00:00
|
|
|
fn main() {
|
|
|
|
let a = 10;
|
|
|
|
|
|
|
|
//This produces a suggestion of 'let b = *&a;' which
|
|
|
|
//will trigger the 'clippy::deref_addrof' lint again
|
|
|
|
let b = **&&a;
|
|
|
|
|
|
|
|
{
|
|
|
|
let mut x = 10;
|
|
|
|
let y = *&mut x;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
//This produces a suggestion of 'let y = *&mut x' which
|
|
|
|
//will trigger the 'clippy::deref_addrof' lint again
|
|
|
|
let mut x = 10;
|
|
|
|
let y = **&mut &mut x;
|
|
|
|
}
|
|
|
|
}
|