mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #35586 - shyaamsundhar:SqushCom, r=jonathandturner
E0248, E0267 & E0268 Change into issue format r? @jonathandturner Part of #35391, #35519 and #35520. I have squashed all changes into a single commit. Please review the changes. E0248 Change in issue format E0267 UT New Format E0268 UT New Format E0267 & E0268 New Error Format
This commit is contained in:
commit
b65ff08d46
@ -77,10 +77,14 @@ impl<'a> CheckLoopVisitor<'a> {
|
||||
match self.cx {
|
||||
Loop => {}
|
||||
Closure => {
|
||||
span_err!(self.sess, span, E0267, "`{}` inside of a closure", name);
|
||||
struct_span_err!(self.sess, span, E0267, "`{}` inside of a closure", name)
|
||||
.span_label(span, &format!("cannot break inside of a closure"))
|
||||
.emit();
|
||||
}
|
||||
Normal => {
|
||||
span_err!(self.sess, span, E0268, "`{}` outside of loop", name);
|
||||
struct_span_err!(self.sess, span, E0268, "`{}` outside of loop", name)
|
||||
.span_label(span, &format!("cannot break outside of a loop"))
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,5 @@
|
||||
|
||||
fn main() {
|
||||
let w = || { break; }; //~ ERROR E0267
|
||||
//~| NOTE cannot break inside of a closure
|
||||
}
|
||||
|
@ -10,4 +10,5 @@
|
||||
|
||||
fn main() {
|
||||
break; //~ ERROR E0268
|
||||
//~| NOTE cannot break outside of a loop
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user