gcc/testsuite/rust/compile/issue-2324-2.rs
raw| 1 | enum State { |
| 2 | Succeeded, |
| 3 | Failed { x: u32 }, |
| 4 | } |
| 5 | |
| 6 | fn print_on_failure(state: &State) { |
| 7 | match *state { |
| 8 | State::Succeeded => (), |
| 9 | State::Failed => (), // { dg-error "expected unit struct, unit variant or constant, found struct variant" } |
| 10 | _ => () |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | fn main() { |
| 15 | let b = State::Failed{x: 1}; |
| 16 | |
| 17 | print_on_failure(&b); |
| 18 | |
| 19 | } |