]>
Commit | Line | Data |
---|---|---|
416331ca XL |
1 | // `Call` terminators can write to a local which has existing loans |
2 | // and those need to be killed like a regular assignment to a local. | |
3 | // This is a simplified version of issue 47680, is correctly accepted | |
4 | // by NLL but was incorrectly rejected by Polonius because of these | |
5 | // missing `killed` facts. | |
6 | ||
7 | // check-pass | |
923072b8 | 8 | // compile-flags: -Z polonius |
416331ca XL |
9 | |
10 | struct Thing; | |
11 | ||
12 | impl Thing { | |
13 | fn next(&mut self) -> &mut Self { unimplemented!() } | |
14 | } | |
15 | ||
16 | fn main() { | |
17 | let mut temp = &mut Thing; | |
18 | ||
19 | loop { | |
20 | let v = temp.next(); | |
21 | temp = v; // accepted by NLL, was incorrectly rejected by Polonius | |
22 | } | |
23 | } |