diff options
Diffstat (limited to 'tests/ui/loop-match/invalid.rs')
| -rw-r--r-- | tests/ui/loop-match/invalid.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/loop-match/invalid.rs b/tests/ui/loop-match/invalid.rs index 0c47b1e0057..08eaf832f56 100644 --- a/tests/ui/loop-match/invalid.rs +++ b/tests/ui/loop-match/invalid.rs @@ -142,6 +142,25 @@ fn break_without_value_unit() { } } +fn break_without_label() { + let mut state = State::A; + let _ = { + #[loop_match] + loop { + state = 'blk: { + match state { + _ => { + #[const_continue] + break State::A; + //~^ ERROR unlabeled `break` inside of a labeled block + //~| ERROR a `#[const_continue]` must break to a label with a value + } + } + } + } + }; +} + fn arm_has_guard(cond: bool) { let mut state = State::A; #[loop_match] |
