summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-multiple-borrows-interior-boxes.rs
blob: 96d2663500ef0e9ab8e72d1537098f09f850727a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test case from #39963.

#[derive(Clone)]
struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);

fn test(f: &mut Foo) {
  match *f {
    Foo(Some(ref mut left), Some(ref mut right)) => match **left {
      Foo(Some(ref mut left), Some(ref mut right)) => panic!(),
      _ => panic!(),
    },
    _ => panic!(),
  }
}

fn main() {
}