]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/self-assign-ref-mut.rs
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / self-assign-ref-mut.rs
1 // Check that `*y` isn't borrowed after `y = y`.
2
3 // check-pass
4
5 fn main() {
6     let mut x = 1;
7     {
8         let mut y = &mut x;
9         y = y;
10         y;
11     }
12     x;
13     {
14         let mut y = &mut x;
15         y = y;
16         y = y;
17         y;
18     }
19     x;
20 }