rust/src/test/run-pass/issues/issue-28839.rs
2018-12-25 21:08:33 -07:00

16 lines
314 B
Rust

// run-pass
// ignore-pretty issue #37199
pub struct Foo;
pub fn get_foo2<'a>(foo: &'a mut Option<&'a mut Foo>) -> &'a mut Foo {
match foo {
// Ensure that this is not considered a move, but rather a reborrow.
&mut Some(ref mut x) => *x,
&mut None => panic!(),
}
}
fn main() {
}