Skip to content

Commit

Permalink
E0164 Update error format #35269
Browse files Browse the repository at this point in the history
- Fixes #35269
- Part of #35233

r? @jonathandturner
  • Loading branch information
gavinb committed Aug 29, 2016
1 parent acd3f79 commit 6355528
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
};
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0164.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 6355528

Please sign in to comment.