diff options
| author | Keith Yeung <kungfukeith11@gmail.com> | 2016-08-07 22:25:04 -0700 |
|---|---|---|
| committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-08-07 22:25:04 -0700 |
| commit | 06133c50f7dc9362875365b3f8cc38ec4bc8d86c (patch) | |
| tree | 078e2ce1aabbb2422df57a0fbe97c78014422fbb | |
| parent | 6153bbbe38ea1a96834b1be4dc457a698c4713b3 (diff) | |
| download | rust-06133c50f7dc9362875365b3f8cc38ec4bc8d86c.tar.gz rust-06133c50f7dc9362875365b3f8cc38ec4bc8d86c.zip | |
Lengthen the span label to include match and expr for E0004
| -rw-r--r-- | src/librustc_const_eval/check_match.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index 2fe4ae627c1..599e3ec871a 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -235,7 +235,12 @@ fn check_expr(cx: &mut MatchCheckCtxt, ex: &hir::Expr) { .flat_map(|arm| &arm.0) .map(|pat| vec![wrap_pat(cx, &pat)]) .collect(); - check_exhaustive(cx, ex.span, &matrix, source); + let match_span = Span { + lo: ex.span.lo, + hi: scrut.span.hi, + expn_id: ex.span.expn_id + }; + check_exhaustive(cx, match_span, &matrix, source); }, _ => () } |
