Skip to content

Commit 1fc18aa

Browse files
committed
Update E0005 to use a label
1 parent db7300d commit 1fc18aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_const_eval/check_match.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,12 @@ fn check_irrefutable(cx: &MatchCheckCtxt, pat: &Pat, is_fn_arg: bool) {
10731073
};
10741074

10751075
is_refutable(cx, pat, |uncovered_pat| {
1076-
span_err!(cx.tcx.sess, pat.span, E0005,
1076+
let pattern_string = pat_to_string(uncovered_pat);
1077+
struct_span_err!(cx.tcx.sess, pat.span, E0005,
10771078
"refutable pattern in {}: `{}` not covered",
10781079
origin,
1079-
pat_to_string(uncovered_pat),
1080-
);
1080+
pattern_string,
1081+
).span_label(pat.span, &format!("pattern `{}` not covered", pattern_string)).emit();
10811082
});
10821083
}
10831084

0 commit comments

Comments
 (0)