From 4725af38bc51760ad36180ebd7d128481b3d8ccc Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Tue, 2 Jun 2020 09:31:10 +0200 Subject: [PATCH] remove assert --- src/librustc_trait_selection/traits/structural_match.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustc_trait_selection/traits/structural_match.rs b/src/librustc_trait_selection/traits/structural_match.rs index dd711b9e256b..87ff667b6a09 100644 --- a/src/librustc_trait_selection/traits/structural_match.rs +++ b/src/librustc_trait_selection/traits/structural_match.rs @@ -251,8 +251,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> { // fields of ADT. let tcx = self.tcx(); for field_ty in adt_def.all_fields().map(|field| field.ty(tcx, substs)) { - assert!(!field_ty.needs_subst()); - let ty = self.tcx().normalize_erasing_regions(ty::ParamEnv::reveal_all(), field_ty); + let ty = self.tcx().normalize_erasing_regions(ty::ParamEnv::empty(), field_ty); debug!("structural-match ADT: field_ty={:?}, ty={:?}", field_ty, ty); if ty.visit_with(self) {