Updated E0026 to new format.
This commit is contained in:
parent
8a4641bbdf
commit
ee38609c20
@ -682,10 +682,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||
field_map.get(&field.name)
|
||||
.map(|f| self.field_ty(span, f, substs))
|
||||
.unwrap_or_else(|| {
|
||||
span_err!(tcx.sess, span, E0026,
|
||||
"struct `{}` does not have a field named `{}`",
|
||||
tcx.item_path_str(variant.did),
|
||||
field.name);
|
||||
struct_span_err!(tcx.sess, span, E0026,
|
||||
"struct `{}` does not have a field named `{}`",
|
||||
tcx.item_path_str(variant.did),
|
||||
field.name)
|
||||
.span_label(span,
|
||||
&format!("struct `{}` does not have field `{}`",
|
||||
tcx.item_path_str(variant.did),
|
||||
field.name))
|
||||
.emit();
|
||||
|
||||
tcx.types.err
|
||||
})
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ struct Thing {
|
||||
fn main() {
|
||||
let thing = Thing { x: 0, y: 0 };
|
||||
match thing {
|
||||
Thing { x, y, z } => {} //~ ERROR E0026
|
||||
Thing { x, y, z } => {}
|
||||
//~^ ERROR struct `Thing` does not have a field named `z` [E0026]
|
||||
//~| NOTE struct `Thing` does not have field `z`
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user