summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow
diff options
context:
space:
mode:
authorb-naber <b_naber@gmx.de>2023-05-04 21:03:57 +0000
committerb-naber <b_naber@gmx.de>2023-05-10 16:03:52 +0000
commite7a2f52ba163a47e751b6e6d666b52c2acdd0949 (patch)
tree2305971c67a1883c2b80fa6ea276adf72ae92dd4 /compiler/rustc_mir_dataflow
parent7871bec7aaad47e8bfaca4fc06c5cb96c466917f (diff)
downloadrust-e7a2f52ba163a47e751b6e6d666b52c2acdd0949.tar.gz
rust-e7a2f52ba163a47e751b6e6d666b52c2acdd0949.zip
don't inline polymorphic adt instances whose fields contain projections
in DropGlue.
Diffstat (limited to 'compiler/rustc_mir_dataflow')
-rw-r--r--compiler/rustc_mir_dataflow/src/elaborate_drops.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
index e2f538e22b7..18895072c3b 100644
--- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
+++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
@@ -272,15 +272,10 @@ 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 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,
-                };
+                assert_eq!(self.elaborator.param_env().reveal(), Reveal::All);
+                let field_ty =
+                    tcx.normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs));
 
                 (tcx.mk_place_field(base_place, field, field_ty), subpath)
             })