Skip to content

Commit afd01f0

Browse files
E0267 & E0268 New Error Format
1 parent 4682a29 commit afd01f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc_passes/loops.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ impl<'a> CheckLoopVisitor<'a> {
7777
match self.cx {
7878
Loop => {}
7979
Closure => {
80-
span_err!(self.sess, span, E0267, "`{}` inside of a closure", name);
80+
struct_span_err!(self.sess, span, E0267, "`{}` inside of a closure", name)
81+
.span_label(span, &format!("cannot break inside of a closure"))
82+
.emit();
8183
}
8284
Normal => {
83-
span_err!(self.sess, span, E0268, "`{}` outside of loop", name);
85+
struct_span_err!(self.sess, span, E0268, "`{}` outside of loop", name)
86+
.span_label(span, &format!("cannot break outside of a loop"))
87+
.emit();
8488
}
8589
}
8690
}

0 commit comments

Comments
 (0)