Skip to content

Commit c2825e1

Browse files
committed
tests that #39963 is fixed on MIR borrowck
1 parent 41affd0 commit c2825e1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test case from #39963.
12+
13+
#![feature(nll)]
14+
15+
#[derive(Clone)]
16+
struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);
17+
18+
fn test(f: &mut Foo) {
19+
match *f {
20+
Foo(Some(ref mut left), Some(ref mut right)) => match **left {
21+
Foo(Some(ref mut left), Some(ref mut right)) => panic!(),
22+
_ => panic!(),
23+
},
24+
_ => panic!(),
25+
}
26+
}
27+
28+
fn main() {
29+
}

0 commit comments

Comments
 (0)