Skip to content

Commit 930c39a

Browse files
committed
dont expect normalization to succeed in elaborate_drops
1 parent c14882f commit 930c39a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

compiler/rustc_mir_dataflow/src/elaborate_drops.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,16 @@ where
272272
let field = FieldIdx::new(i);
273273
let subpath = self.elaborator.field_subpath(variant_path, field);
274274
let tcx = self.tcx();
275-
276275
assert_eq!(self.elaborator.param_env().reveal(), Reveal::All);
277-
let field_ty =
278-
tcx.normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs));
276+
277+
let fty = f.ty(tcx, substs);
278+
let field_ty = match tcx
279+
.try_normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs))
280+
{
281+
Ok(f_ty) => f_ty,
282+
Err(_) => fty,
283+
};
284+
279285
(tcx.mk_place_field(base_place, field, field_ty), subpath)
280286
})
281287
.collect()

0 commit comments

Comments
 (0)