E0248 Change in issue format

E0248 Change in issue format

E0267 UT New Format

E0268 UT New Format

E0267 & E0268 New Error Format
This commit is contained in:
ShyamSundarB 2016-08-08 00:12:53 +05:30 committed by Shyam Sundar B
parent f5e7a5910d
commit 1a6fac7ed2
5 changed files with 14 additions and 6 deletions

View File

@ -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();
}
}
}

View File

@ -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;
}
}

View File

@ -13,6 +13,6 @@ enum Foo {
}
fn do_something(x: Foo::Bar) { } //~ ERROR E0248
//~| NOTE value used as a type
fn main() {
}

View File

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

View File

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