1 #![feature(tool_lints)]
4 fn get_number() -> usize {
8 fn get_reference(n : &usize) -> &usize {
12 #[allow(clippy::many_single_char_names, clippy::double_parens)]
13 #[allow(unused_variables)]
14 #[warn(clippy::deref_addrof)]
21 let b = *&get_number();
23 let b = *get_reference(&a);
25 let bytes : Vec<usize> = vec![1, 2, 3, 4];
26 let b = *&bytes[1..2][0];
28 //This produces a suggestion of 'let b = (a);' which
29 //will trigger the 'unused_parens' lint
40 //This produces a suggestion of 'let b = *&a;' which
41 //will trigger the 'clippy::deref_addrof' lint again
50 //This produces a suggestion of 'let y = *&mut x' which
51 //will trigger the 'clippy::deref_addrof' lint again
53 let y = **&mut &mut x;