]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/self-assign-ref-mut.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[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 }