Skip to content

Remove check_match from const_eval #59781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions src/librustc_mir/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth preserving this comment.

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| {
Expand Down