Add a test for #10876
This commit is contained in:
parent
8f4c226fc5
commit
5c563f98b8
19
src/test/ui/borrowck/issue-10876.rs
Normal file
19
src/test/ui/borrowck/issue-10876.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// run-pass
|
||||
|
||||
#![feature(nll)]
|
||||
|
||||
enum Nat {
|
||||
S(Box<Nat>),
|
||||
Z
|
||||
}
|
||||
fn test(x: &mut Nat) {
|
||||
let mut p = &mut *x;
|
||||
loop {
|
||||
match p {
|
||||
&mut Nat::Z => break,
|
||||
&mut Nat::S(ref mut n) => p = &mut *n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user