Skip to content

Commit

Permalink
E0248 Change in issue format
Browse files Browse the repository at this point in the history
E0248 Change in issue format

E0267 UT New Format

E0268 UT New Format

E0267 & E0268 New Error Format
shyamsundarb-arch committed Aug 9, 2016
1 parent f5e7a59 commit 1a6fac7
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/librustc_passes/loops.rs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
8 changes: 5 additions & 3 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
@@ -1582,9 +1582,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
return self.tcx().types.err;
}
_ => {
span_err!(tcx.sess, span, E0248,
"found value `{}` used as a type",
tcx.item_path_str(def.def_id()));
struct_span_err!(tcx.sess, span, E0248,
"found value `{}` used as a type",
tcx.item_path_str(def.def_id()))
.span_label(span, &format!("value used as a type"))
.emit();
return self.tcx().types.err;
}
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0248.rs
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ enum Foo {
}

fn do_something(x: Foo::Bar) { } //~ ERROR E0248

//~| NOTE value used as a type
fn main() {
}
1 change: 1 addition & 0 deletions src/test/compile-fail/E0267.rs
Original file line number Diff line number Diff line change
@@ -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
@@ -10,4 +10,5 @@

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

0 comments on commit 1a6fac7

Please sign in to comment.