Skip to content

Commit bd7a802

Browse files
committed
Remove check_match from const_eval
1 parent 05b4554 commit bd7a802

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/librustc_mir/const_eval.rs

+3-16
Original file line numberDiff line numberDiff line change
@@ -615,22 +615,9 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
615615
let cid = key.value;
616616
let def_id = cid.instance.def.def_id();
617617

618-
if let Some(id) = tcx.hir().as_local_hir_id(def_id) {
619-
let tables = tcx.typeck_tables_of(def_id);
620-
621-
// Do match-check before building MIR
622-
// FIXME(#59378) check_match may have errored but we're not checking for that anymore
623-
tcx.check_match(def_id);
624-
625-
if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind_by_hir_id(id) {
626-
tcx.mir_const_qualif(def_id);
627-
}
628-
629-
// Do not continue into miri if typeck errors occurred; it will fail horribly
630-
if tables.tainted_by_errors {
631-
return Err(ErrorHandled::Reported)
632-
}
633-
};
618+
if def_id.is_local() && tcx.typeck_tables_of(def_id).tainted_by_errors {
619+
return Err(ErrorHandled::Reported);
620+
}
634621

635622
let (res, ecx) = eval_body_and_ecx(tcx, cid, None, key.param_env);
636623
res.and_then(|place| {

0 commit comments

Comments
 (0)