blob: 22eaa119f2467167e57ed7373b8b9df23e00f145 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// check-pass
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() {}
|