]> git.lizzy.rs Git - rust.git/blob - tests/ui/deref_addrof_double_trigger.rs
Merge remote-tracking branch 'origin/beta_backport' into HEAD
[rust.git] / tests / ui / deref_addrof_double_trigger.rs
1 #[warn(clippy::deref_addrof)]
2 #[allow(unused_variables)]
3 fn main() {
4     let a = 10;
5
6     //This produces a suggestion of 'let b = *&a;' which
7     //will trigger the 'clippy::deref_addrof' lint again
8     let b = **&&a;
9
10     {
11         let mut x = 10;
12         let y = *&mut x;
13     }
14
15     {
16         //This produces a suggestion of 'let y = *&mut x' which
17         //will trigger the 'clippy::deref_addrof' lint again
18         let mut x = 10;
19         let y = **&mut &mut x;
20     }
21 }