@@ -2129,29 +2129,24 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2129
2129
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
2130
2130
// We create a fresh `ty::ParamEnv` instead of the one for `self.item_def_id()`
2131
2131
// 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 ( ) ;
2137
2133
let traits: Vec < _ > = self
2138
2134
. tcx ( )
2139
2135
. all_traits ( )
2140
2136
. filter ( |trait_def_id| {
2141
2137
// Consider only traits with the associated type
2142
2138
tcx. associated_items ( * trait_def_id)
2143
2139
. in_definition_order ( )
2144
- . find ( |i| {
2140
+ . any ( |i| {
2145
2141
i. kind . namespace ( ) == Namespace :: TypeNS
2146
2142
&& i. ident ( tcx) . normalize_to_macros_2_0 ( ) == assoc_ident
2147
2143
&& matches ! ( i. kind, ty:: AssocKind :: Type )
2148
2144
} )
2149
- . is_some ( )
2150
2145
// Consider only accessible traits
2151
2146
&& tcx. visibility ( * trait_def_id)
2152
2147
. is_accessible_from ( self . item_def_id ( ) , tcx)
2153
2148
&& tcx. all_impls ( * trait_def_id)
2154
- . filter ( |impl_def_id| {
2149
+ . any ( |impl_def_id| {
2155
2150
let trait_ref = tcx. impl_trait_ref ( impl_def_id) ;
2156
2151
trait_ref. map_or ( false , |impl_| {
2157
2152
infcx
@@ -2164,8 +2159,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2164
2159
} )
2165
2160
&& tcx. impl_polarity ( impl_def_id) != ty:: ImplPolarity :: Negative
2166
2161
} )
2167
- . next ( )
2168
- . is_some ( )
2169
2162
} )
2170
2163
. map ( |trait_def_id| tcx. def_path_str ( trait_def_id) )
2171
2164
. collect ( ) ;
@@ -2305,7 +2298,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2305
2298
. filter_map ( |impl_def_id| tcx. impl_trait_ref ( impl_def_id) )
2306
2299
. map ( |impl_| impl_. self_ty ( ) )
2307
2300
// 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 ( ) )
2309
2302
. map ( |self_ty| tcx. erase_regions ( self_ty) . to_string ( ) )
2310
2303
. collect ( )
2311
2304
} ;
0 commit comments