Skip to content

Commit 6355528

Browse files
committed
E0164 Update error format #35269
- Fixes #35269 - Part of #35233 r? @jonathandturner
1 parent acd3f79 commit 6355528

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustc_typeck/check/_match.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
574574
tcx.sess.add_lint(lint::builtin::MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
575575
pat.id, pat.span, msg);
576576
} else {
577-
span_err!(tcx.sess, pat.span, E0164, "{}", msg);
577+
struct_span_err!(tcx.sess, pat.span, E0164, "{}", msg)
578+
.span_label(pat.span, &format!("not a tuple variant or struct")).emit();
578579
on_error();
579580
}
580581
};

src/test/compile-fail/E0164.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum Foo { B { i: u32 } }
1313
fn bar(foo: Foo) -> u32 {
1414
match foo {
1515
Foo::B(i) => i, //~ ERROR E0164
16+
//~| NOTE not a tuple variant or struct
1617
}
1718
}
1819

0 commit comments

Comments
 (0)