Skip to content

Commit fa8a4fc

Browse files
committed
Add a test for rust-lang#10876
1 parent e68bf8a commit fa8a4fc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/test/ui/borrowck/issue-10876.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// run-pass
2+
3+
#![feature(nll)]
4+
5+
enum Nat {
6+
S(Box<Nat>),
7+
Z
8+
}
9+
fn test(x: &mut Nat) {
10+
let mut p = &mut *x;
11+
loop {
12+
match p {
13+
&mut Nat::Z => break,
14+
&mut Nat::S(ref mut n) => p = &mut *n
15+
}
16+
}
17+
}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)