]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-10876.rs
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / borrowck / issue-10876.rs
1 // check-pass
2
3 enum Nat {
4     S(Box<Nat>),
5     Z
6 }
7 fn test(x: &mut Nat) {
8     let mut p = &mut *x;
9     loop {
10         match p {
11             &mut Nat::Z => break,
12             &mut Nat::S(ref mut n) => p = &mut *n
13         }
14     }
15 }
16
17 fn main() {}