Skip to content

Commit 5ef4716

Browse files
committed
Tweak bad continue error
1 parent 3893d16 commit 5ef4716

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/librustc_passes/loops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
144144
"`continue` pointing to a labeled block")
145145
.span_label(e.span,
146146
"labeled blocks cannot be `continue`'d")
147-
.span_note(block.span,
148-
"labeled block the continue points to")
147+
.span_label(block.span,
148+
"labeled block the `continue` points to")
149149
.emit();
150150
}
151151
}

src/test/ui/label/label_break_value_continue.stderr

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ LL | continue;
77
error[E0696]: `continue` pointing to a labeled block
88
--> $DIR/label_break_value_continue.rs:14:9
99
|
10-
LL | continue 'b;
11-
| ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
12-
|
13-
note: labeled block the continue points to
14-
--> $DIR/label_break_value_continue.rs:13:5
15-
|
1610
LL | / 'b: {
1711
LL | | continue 'b;
12+
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
1813
LL | | }
19-
| |_____^
14+
| |_____- labeled block the `continue` points to
2015

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

0 commit comments

Comments
 (0)