Skip to content

Commit 06133c5

Browse files
committed
Lengthen the span label to include match and expr for E0004
1 parent 6153bbb commit 06133c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_const_eval/check_match.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@ fn check_expr(cx: &mut MatchCheckCtxt, ex: &hir::Expr) {
235235
.flat_map(|arm| &arm.0)
236236
.map(|pat| vec![wrap_pat(cx, &pat)])
237237
.collect();
238-
check_exhaustive(cx, ex.span, &matrix, source);
238+
let match_span = Span {
239+
lo: ex.span.lo,
240+
hi: scrut.span.hi,
241+
expn_id: ex.span.expn_id
242+
};
243+
check_exhaustive(cx, match_span, &matrix, source);
239244
},
240245
_ => ()
241246
}

0 commit comments

Comments
 (0)