@@ -4,8 +4,7 @@ use rustc_hir::def::DefKind;
4
4
use rustc_index:: bit_set:: BitSet ;
5
5
use rustc_middle:: query:: Providers ;
6
6
use rustc_middle:: ty:: {
7
- self , EarlyBinder , ImplTraitInTraitData , ToPredicate , Ty , TyCtxt , TypeSuperVisitable ,
8
- TypeVisitable , TypeVisitor ,
7
+ self , EarlyBinder , ToPredicate , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitor ,
9
8
} ;
10
9
use rustc_session:: config:: TraitSolver ;
11
10
use rustc_span:: def_id:: { DefId , LocalDefId , CRATE_DEF_ID } ;
@@ -120,22 +119,6 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
120
119
let ty:: InstantiatedPredicates { mut predicates, .. } =
121
120
tcx. predicates_of ( def_id) . instantiate_identity ( tcx) ;
122
121
123
- // When computing the param_env of an RPITIT, use predicates of the containing function,
124
- // *except* for the additional assumption that the RPITIT normalizes to the trait method's
125
- // default opaque type. This is needed to properly check the item bounds of the assoc
126
- // type hold (`check_type_bounds`), since that method already installs a similar projection
127
- // bound, so they will conflict.
128
- // FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): I don't like this, we should
129
- // at least be making sure that the generics in RPITITs and their parent fn don't
130
- // get out of alignment, or else we do actually need to substitute these predicates.
131
- if let Some ( ImplTraitInTraitData :: Trait { fn_def_id, .. } )
132
- | Some ( ImplTraitInTraitData :: Impl { fn_def_id, .. } ) = tcx. opt_rpitit_info ( def_id)
133
- {
134
- // FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): Should not need to add the predicates
135
- // from the parent fn to our assumptions
136
- predicates. extend ( tcx. predicates_of ( fn_def_id) . instantiate_identity ( tcx) . predicates ) ;
137
- }
138
-
139
122
// Finally, we have to normalize the bounds in the environment, in
140
123
// case they contain any associated type projections. This process
141
124
// can yield errors if the put in illegal associated types, like
0 commit comments