@@ -29,9 +29,7 @@ use rustc_infer::infer::TyCtxtInferExt;
29
29
use rustc_middle:: hir:: nested_filter;
30
30
use rustc_middle:: ty:: query:: Providers ;
31
31
use rustc_middle:: ty:: util:: { Discr , IntTypeExt } ;
32
- use rustc_middle:: ty:: {
33
- self , AdtKind , Const , IsSuggestable , ToPredicate , Ty , TyCtxt , TypeVisitable ,
34
- } ;
32
+ use rustc_middle:: ty:: { self , AdtKind , Const , IsSuggestable , ToPredicate , Ty , TyCtxt } ;
35
33
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
36
34
use rustc_span:: Span ;
37
35
use rustc_target:: spec:: abi;
@@ -1270,7 +1268,7 @@ fn suggest_impl_iterator<'tcx>(
1270
1268
if !tcx
1271
1269
. infer_ctxt ( )
1272
1270
. build ( )
1273
- . type_implements_trait ( iter_trait, [ ret_ty] , tcx. param_env ( iter_trait ) )
1271
+ . type_implements_trait ( iter_trait, [ ret_ty] , tcx. param_env ( def_id ) )
1274
1272
. must_apply_modulo_regions ( )
1275
1273
{
1276
1274
return None ;
@@ -1296,8 +1294,7 @@ fn suggest_impl_iterator<'tcx>(
1296
1294
) ) ;
1297
1295
if ocx. select_where_possible ( ) . is_empty ( )
1298
1296
&& let item_ty = infcx. resolve_vars_if_possible ( ty_var)
1299
- && !item_ty. references_error ( )
1300
- && !item_ty. has_placeholders ( )
1297
+ && item_ty. is_suggestable ( tcx, false )
1301
1298
{
1302
1299
return Some ( item_ty) ;
1303
1300
}
0 commit comments