2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_assignments)]
|
|
|
|
#![allow(unused_variables)]
|
2015-01-04 05:22:59 -05: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 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn foo(x: &isize) {
|
2015-01-04 05:22:59 -05:00
|
|
|
let a = 1;
|
|
|
|
match x {
|
|
|
|
mut z => {
|
|
|
|
z = &a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
foo(&1);
|
|
|
|
}
|