Debian Codegraph @

gcc/testsuite/rust/compile/match_break.rs

raw
1 // { dg-additional-options "-frust-compile-until=ast" }
2 enum Nat {
3 S(Box<Nat>),
4 Z,
5 }
6 fn test(x: &mut Nat) {
7 let mut p = &mut *x;
8 loop {
9 match p {
10 &mut Nat::Z => break,
11 &mut Nat::S(ref mut n) => p = &mut *n,
12 }
13 }
14 }