summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-28839.rs
blob: 73be87a0c1e692fb0314b265cd68826959291e60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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() {
}