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:
Eduard-Mihai Burtescu 2016-08-14 20:29:49 +03:00 committed by GitHub
commit b65ff08d46
3 changed files with 8 additions and 2 deletions

View File

@ -77,10 +77,14 @@ impl<'a> CheckLoopVisitor<'a> {
match self.cx { match self.cx {
Loop => {} Loop => {}
Closure => { 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 => { 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();
} }
} }
} }

View File

@ -10,4 +10,5 @@
fn main() { fn main() {
let w = || { break; }; //~ ERROR E0267 let w = || { break; }; //~ ERROR E0267
//~| NOTE cannot break inside of a closure
} }

View File

@ -10,4 +10,5 @@
fn main() { fn main() {
break; //~ ERROR E0268 break; //~ ERROR E0268
//~| NOTE cannot break outside of a loop
} }