@@ -286,7 +286,7 @@ fn parse_iter_usage<'tcx>(
286
286
let iter_id = cx. tcx . get_diagnostic_item ( sym:: Iterator ) ?;
287
287
288
288
match ( name. ident . name , args) {
289
- ( sym:: next, [ ] ) if cx. tcx . trait_of_item ( did) == Some ( iter_id) => ( IterUsageKind :: Nth ( 0 ) , e. span ) ,
289
+ ( sym:: next, [ ] ) if cx. tcx . trait_of_assoc ( did) == Some ( iter_id) => ( IterUsageKind :: Nth ( 0 ) , e. span ) ,
290
290
( sym:: next_tuple, [ ] ) => {
291
291
return if paths:: ITERTOOLS_NEXT_TUPLE . matches ( cx, did)
292
292
&& let ty:: Adt ( adt_def, subs) = cx. typeck_results ( ) . expr_ty ( e) . kind ( )
@@ -303,7 +303,7 @@ fn parse_iter_usage<'tcx>(
303
303
None
304
304
} ;
305
305
} ,
306
- ( sym:: nth | sym:: skip, [ idx_expr] ) if cx. tcx . trait_of_item ( did) == Some ( iter_id) => {
306
+ ( sym:: nth | sym:: skip, [ idx_expr] ) if cx. tcx . trait_of_assoc ( did) == Some ( iter_id) => {
307
307
if let Some ( Constant :: Int ( idx) ) = ConstEvalCtxt :: new ( cx) . eval ( idx_expr) {
308
308
let span = if name. ident . as_str ( ) == "nth" {
309
309
e. span
@@ -312,7 +312,7 @@ fn parse_iter_usage<'tcx>(
312
312
&& next_name. ident . name == sym:: next
313
313
&& next_expr. span . ctxt ( ) == ctxt
314
314
&& let Some ( next_id) = cx. typeck_results ( ) . type_dependent_def_id ( next_expr. hir_id )
315
- && cx. tcx . trait_of_item ( next_id) == Some ( iter_id)
315
+ && cx. tcx . trait_of_assoc ( next_id) == Some ( iter_id)
316
316
{
317
317
next_expr. span
318
318
} else {
0 commit comments