@@ -2129,29 +2129,24 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
21292129 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
21302130 // We create a fresh `ty::ParamEnv` instead of the one for `self.item_def_id()`
21312131 // to avoid a cycle error in `src/test/ui/resolve/issue-102946.rs`.
2132- let param_env = ty:: ParamEnv :: new (
2133- ty:: List :: empty ( ) ,
2134- traits:: Reveal :: All ,
2135- hir:: Constness :: NotConst ,
2136- ) ;
2132+ let param_env = ty:: ParamEnv :: empty ( ) ;
21372133 let traits: Vec < _ > = self
21382134 . tcx ( )
21392135 . all_traits ( )
21402136 . filter ( |trait_def_id| {
21412137 // Consider only traits with the associated type
21422138 tcx. associated_items ( * trait_def_id)
21432139 . in_definition_order ( )
2144- . find ( |i| {
2140+ . any ( |i| {
21452141 i. kind . namespace ( ) == Namespace :: TypeNS
21462142 && i. ident ( tcx) . normalize_to_macros_2_0 ( ) == assoc_ident
21472143 && matches ! ( i. kind, ty:: AssocKind :: Type )
21482144 } )
2149- . is_some ( )
21502145 // Consider only accessible traits
21512146 && tcx. visibility ( * trait_def_id)
21522147 . is_accessible_from ( self . item_def_id ( ) , tcx)
21532148 && tcx. all_impls ( * trait_def_id)
2154- . filter ( |impl_def_id| {
2149+ . any ( |impl_def_id| {
21552150 let trait_ref = tcx. impl_trait_ref ( impl_def_id) ;
21562151 trait_ref. map_or ( false , |impl_| {
21572152 infcx
@@ -2164,8 +2159,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
21642159 } )
21652160 && tcx. impl_polarity ( impl_def_id) != ty:: ImplPolarity :: Negative
21662161 } )
2167- . next ( )
2168- . is_some ( )
21692162 } )
21702163 . map ( |trait_def_id| tcx. def_path_str ( trait_def_id) )
21712164 . collect ( ) ;
@@ -2305,7 +2298,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
23052298 . filter_map ( |impl_def_id| tcx. impl_trait_ref ( impl_def_id) )
23062299 . map ( |impl_| impl_. self_ty ( ) )
23072300 // We don't care about blanket impls.
2308- . filter ( |self_ty| !self_ty. has_non_region_infer ( ) )
2301+ . filter ( |self_ty| !self_ty. has_non_region_param ( ) )
23092302 . map ( |self_ty| tcx. erase_regions ( self_ty) . to_string ( ) )
23102303 . collect ( )
23112304 } ;
0 commit comments