From 930c39aa8fa73f915894bf6f3330c2880e8a1547 Mon Sep 17 00:00:00 2001 From: b-naber Date: Fri, 28 Apr 2023 07:17:19 +0000 Subject: [PATCH] dont expect normalization to succeed in elaborate_drops --- compiler/rustc_mir_dataflow/src/elaborate_drops.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index 2e68c794356..e2f538e22b7 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -272,10 +272,16 @@ where let field = FieldIdx::new(i); let subpath = self.elaborator.field_subpath(variant_path, field); let tcx = self.tcx(); - assert_eq!(self.elaborator.param_env().reveal(), Reveal::All); - let field_ty = - tcx.normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs)); + + let fty = f.ty(tcx, substs); + let field_ty = match tcx + .try_normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs)) + { + Ok(f_ty) => f_ty, + Err(_) => fty, + }; + (tcx.mk_place_field(base_place, field, field_ty), subpath) }) .collect()