Add a test for #10876

This commit is contained in:
varkor 2019-02-25 23:07:12 +00:00
parent 8f4c226fc5
commit 5c563f98b8

View 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() {}