Navigation Menu

Skip to content

Commit

Permalink
Tweak bad continue error
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 25, 2019
1 parent 3893d16 commit 5ef4716
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/librustc_passes/loops.rs
Expand Up @@ -144,8 +144,8 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
"`continue` pointing to a labeled block")
.span_label(e.span,
"labeled blocks cannot be `continue`'d")
.span_note(block.span,
"labeled block the continue points to")
.span_label(block.span,
"labeled block the `continue` points to")
.emit();
}
}
Expand Down
9 changes: 2 additions & 7 deletions src/test/ui/label/label_break_value_continue.stderr
Expand Up @@ -7,16 +7,11 @@ LL | continue;
error[E0696]: `continue` pointing to a labeled block
--> $DIR/label_break_value_continue.rs:14:9
|
LL | continue 'b;
| ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
|
note: labeled block the continue points to
--> $DIR/label_break_value_continue.rs:13:5
|
LL | / 'b: {
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | }
| |_____^
| |_____- labeled block the `continue` points to

error[E0695]: unlabeled `continue` inside of a labeled block
--> $DIR/label_break_value_continue.rs:22:13
Expand Down

0 comments on commit 5ef4716

Please sign in to comment.