2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_assignments)]
|
|
|
|
#![allow(unused_variables)]
|
2015-01-04 04:22:59 -06:00
|
|
|
// Check that the type checker permits us to reassign `z` which
|
|
|
|
// started out with a longer lifetime and was reassigned to a shorter
|
|
|
|
// one (it should infer to be the intersection).
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn foo(x: &isize) {
|
2015-01-04 04:22:59 -06:00
|
|
|
let a = 1;
|
|
|
|
match x {
|
|
|
|
mut z => {
|
|
|
|
z = &a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
foo(&1);
|
|
|
|
}
|