E0164 Update error format #35269
- Fixes #35269 - Part of #35233 r? @jonathandturner
This commit is contained in:
parent
acd3f796d2
commit
6355528ffd
2 changed files with 3 additions and 1 deletions
|
|
@ -574,7 +574,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
tcx.sess.add_lint(lint::builtin::MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
|
||||
pat.id, pat.span, msg);
|
||||
} else {
|
||||
span_err!(tcx.sess, pat.span, E0164, "{}", msg);
|
||||
struct_span_err!(tcx.sess, pat.span, E0164, "{}", msg)
|
||||
.span_label(pat.span, &format!("not a tuple variant or struct")).emit();
|
||||
on_error();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ enum Foo { B { i: u32 } }
|
|||
fn bar(foo: Foo) -> u32 {
|
||||
match foo {
|
||||
Foo::B(i) => i, //~ ERROR E0164
|
||||
//~| NOTE not a tuple variant or struct
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue