]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 XL |
2 | #![allow(unused_assignments)] |
3 | #![allow(unused_variables)] | |
1a4d82fc JJ |
4 | // Check that the type checker permits us to reassign `z` which |
5 | // started out with a longer lifetime and was reassigned to a shorter | |
6 | // one (it should infer to be the intersection). | |
223e47cc | 7 | |
c34b1796 AL |
8 | // pretty-expanded FIXME #23616 |
9 | ||
10 | fn foo(x: &isize) { | |
1a4d82fc JJ |
11 | let a = 1; |
12 | let mut z = x; | |
13 | z = &a; | |
223e47cc LB |
14 | } |
15 | ||
16 | pub fn main() { | |
1a4d82fc | 17 | foo(&1); |
223e47cc | 18 | } |