Skip to content

Commit

Permalink
Rollup merge of rust-lang#35586 - shyaamsundhar:SqushCom, r=jonathand…
Browse files Browse the repository at this point in the history
…turner

E0248, E0267 & E0268 Change into issue format

r? @jonathandturner  Part of rust-lang#35391, rust-lang#35519 and rust-lang#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
  • Loading branch information
eddyb authored Aug 14, 2016
2 parents da2328b + 1a6fac7 commit b65ff08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/librustc_passes/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0267.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

fn main() {
let w = || { break; }; //~ ERROR E0267
//~| NOTE cannot break inside of a closure
}
1 change: 1 addition & 0 deletions src/test/compile-fail/E0268.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

fn main() {
break; //~ ERROR E0268
//~| NOTE cannot break outside of a loop
}

0 comments on commit b65ff08

Please sign in to comment.