Skip to content

Commit 8a4641b

Browse files
authored
Auto merge of rust-lang#35485 - KiChjang:e0004-bonus, r=GuillaumeGomez
Lengthen the span label to include match and expr for E0004 Part of rust-lang#35233. Extension of rust-lang#35191. r? @GuillaumeGomez
2 parents 6153bbb + 06133c5 commit 8a4641b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_const_eval/check_match.rs

Lines changed: 6 additions & 1 deletion
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)