]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/self-assign-ref-mut.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / 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 }