about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIsaac Whitfield <iw@whitfin.io>2019-04-06 17:25:44 -0700
committerIsaac Whitfield <iw@whitfin.io>2019-04-06 17:25:44 -0700
commitbd7a8020cc7530f21006154d130c0896b6c47c9a (patch)
treef8c7e49949875b8ae1a3d66abba6f5effac4b9ca
parent05b4554e77ef32a97060b1bfffd1f621bf15bb88 (diff)
downloadrust-bd7a8020cc7530f21006154d130c0896b6c47c9a.tar.gz
rust-bd7a8020cc7530f21006154d130c0896b6c47c9a.zip
Remove check_match from const_eval
-rw-r--r--src/librustc_mir/const_eval.rs19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs
index 33715b749f9..4c8ab361e04 100644
--- a/src/librustc_mir/const_eval.rs
+++ b/src/librustc_mir/const_eval.rs
@@ -615,22 +615,9 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
     let cid = key.value;
     let def_id = cid.instance.def.def_id();
 
-    if let Some(id) = tcx.hir().as_local_hir_id(def_id) {
-        let tables = tcx.typeck_tables_of(def_id);
-
-        // Do match-check before building MIR
-        // FIXME(#59378) check_match may have errored but we're not checking for that anymore
-        tcx.check_match(def_id);
-
-        if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind_by_hir_id(id) {
-            tcx.mir_const_qualif(def_id);
-        }
-
-        // Do not continue into miri if typeck errors occurred; it will fail horribly
-        if tables.tainted_by_errors {
-            return Err(ErrorHandled::Reported)
-        }
-    };
+    if def_id.is_local() && tcx.typeck_tables_of(def_id).tainted_by_errors {
+        return Err(ErrorHandled::Reported);
+    }
 
     let (res, ecx) = eval_body_and_ecx(tcx, cid, None, key.param_env);
     res.and_then(|place| {