1
Fork 0

Bail out of MIR construction if check_match fails

This commit is contained in:
clubby789 2023-04-30 16:31:36 +01:00
parent c1bb0e0911
commit 2d5ca0ea4f
5 changed files with 154 additions and 13 deletions

View file

@ -42,7 +42,9 @@ fn mir_build(tcx: TyCtxt<'_>, def: LocalDefId) -> Body<'_> {
// Ensure unsafeck and abstract const building is ran before we steal the THIR.
tcx.ensure_with_value().thir_check_unsafety(def);
tcx.ensure_with_value().thir_abstract_const(def);
tcx.ensure_with_value().check_match(def);
if let Err(e) = tcx.check_match(def) {
return construct_error(tcx, def, e);
}
let body = match tcx.thir_body(def) {
Err(error_reported) => construct_error(tcx, def, error_reported),