]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-multiple-borrows-interior-boxes.rs
Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, r=davidtwco
[rust.git] / tests / ui / borrowck / borrowck-multiple-borrows-interior-boxes.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 // Test case from #39963.
5
6 #[derive(Clone)]
7 struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);
8
9 fn test(f: &mut Foo) {
10   match *f {
11     Foo(Some(ref mut left), Some(ref mut right)) => match **left {
12       Foo(Some(ref mut left), Some(ref mut right)) => panic!(),
13       _ => panic!(),
14     },
15     _ => panic!(),
16   }
17 }
18
19 fn main() {
20 }