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