]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #35485 - KiChjang:e0004-bonus, r=GuillaumeGomez
authorbors <bors@rust-lang.org>
Mon, 8 Aug 2016 10:35:19 +0000 (03:35 -0700)
committerGitHub <noreply@github.com>
Mon, 8 Aug 2016 10:35:19 +0000 (03:35 -0700)
Lengthen the span label to include match and expr for E0004

Part of #35233.
Extension of #35191.

r? @GuillaumeGomez

src/librustc_const_eval/check_match.rs

index 2fe4ae627c1dc7be3ea12168369e8df3cb17939f..599e3ec871a8327cdcc08f18083a042806bd7945 100644 (file)
@@ -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);
         },
         _ => ()
     }