From 6355528ffda28e77850f739d5c51ab48e8a68bb1 Mon Sep 17 00:00:00 2001 From: Gavin Baker Date: Mon, 29 Aug 2016 11:55:30 +1000 Subject: [PATCH] E0164 Update error format #35269 - Fixes #35269 - Part of #35233 r? @jonathandturner --- src/librustc_typeck/check/_match.rs | 3 ++- src/test/compile-fail/E0164.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 78175c85b19b..225468cb9f40 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -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(); } }; diff --git a/src/test/compile-fail/E0164.rs b/src/test/compile-fail/E0164.rs index 491b2e9e5b24..1665a80bead7 100644 --- a/src/test/compile-fail/E0164.rs +++ b/src/test/compile-fail/E0164.rs @@ -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 } }