2018-09-04 12:05:53 +02:00
|
|
|
// run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-08-20 12:23:37 -07:00
|
|
|
let mut x = None;
|
2012-08-06 12:34:08 -07:00
|
|
|
match x {
|
2012-08-20 12:23:37 -07:00
|
|
|
None => {
|
2012-04-26 16:02:01 -07:00
|
|
|
// It is ok to reassign x here, because there is in
|
|
|
|
// fact no outstanding loan of x!
|
2015-01-25 22:05:03 +01:00
|
|
|
x = Some(0);
|
2012-04-26 16:02:01 -07:00
|
|
|
}
|
2012-08-20 12:23:37 -07:00
|
|
|
Some(_) => { }
|
2012-04-26 16:02:01 -07:00
|
|
|
}
|
2013-08-17 08:37:42 -07:00
|
|
|
assert_eq!(x, Some(0));
|
2012-04-26 16:02:01 -07:00
|
|
|
}
|