@@ -10,8 +10,7 @@ use rustc_trait_selection::traits::auto_trait::{self, RegionTarget};
1010use tracing:: { debug, instrument} ;
1111
1212use crate :: clean:: {
13- self , Lifetime , clean_clause, clean_generic_param_def, clean_middle_ty,
14- clean_trait_ref_with_constraints, clean_ty_generics_inner, simplify,
13+ self , Lifetime , clean_clause_uninterned, clean_generic_param_def, clean_middle_ty, clean_trait_ref_with_constraints, clean_ty_generics_inner, simplify,
1514} ;
1615use crate :: core:: DocContext ;
1716
@@ -174,18 +173,16 @@ fn clean_param_env<'tcx>(
174173
175174 // FIXME(#111101): Incorporate the explicit predicates of the item here...
176175 let item_clauses: FxIndexSet < _ > =
177- tcx. param_env ( item_def_id) . caller_bounds ( ) . all_clauses ( tcx) . iter ( ) . collect ( ) ;
176+ tcx. param_env ( item_def_id) . caller_bounds ( ) . trait_clauses ( tcx) . iter ( ) . collect ( ) ;
177+ let sized_trait = tcx. lang_items ( ) . sized_trait ( ) ;
178178 let where_predicates = cx. with_exact_param_env ( param_env, |cx| {
179179 param_env
180180 . caller_bounds ( )
181- . all_clauses ( tcx)
181+ . trait_clauses ( tcx)
182182 . iter ( )
183183 // FIXME: ...which hopefully allows us to simplify this:
184- . filter ( |clause| {
185- !item_clauses. contains ( clause)
186- || clause. as_trait_clause ( ) . is_some_and ( |clause| {
187- tcx. lang_items ( ) . sized_trait ( ) == Some ( clause. def_id ( ) )
188- } )
184+ . filter ( |trait_clause| {
185+ !item_clauses. contains ( trait_clause) || Some ( trait_clause. def_id ( ) ) == sized_trait
189186 } )
190187 . map ( |clause| {
191188 fold_regions ( tcx, clause, |r, _| match r. kind ( ) {
@@ -202,7 +199,7 @@ fn clean_param_env<'tcx>(
202199 }
203200 } )
204201 } )
205- . flat_map ( |clause| clean_clause ( clause, cx) )
202+ . flat_map ( |clause| clean_clause_uninterned ( clause. map_bound ( ty :: ClauseKind :: Trait ) , cx) )
206203 . chain ( clean_region_outlives_constraints ( & region_data, generics) )
207204 . collect ( )
208205 } ) ;
0 commit comments