mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
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:
parent
f5e7a5910d
commit
1a6fac7ed2
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,6 @@ enum Foo {
|
||||
}
|
||||
|
||||
fn do_something(x: Foo::Bar) { } //~ ERROR E0248
|
||||
|
||||
//~| NOTE value used as a type
|
||||
fn main() {
|
||||
}
|
||||
|
@ -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