@@ -286,7 +286,7 @@ fn parse_iter_usage<'tcx>(
286286 let iter_id = cx. tcx . get_diagnostic_item ( sym:: Iterator ) ?;
287287
288288 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 ) ,
290290 ( sym:: next_tuple, [ ] ) => {
291291 return if paths:: ITERTOOLS_NEXT_TUPLE . matches ( cx, did)
292292 && let ty:: Adt ( adt_def, subs) = cx. typeck_results ( ) . expr_ty ( e) . kind ( )
@@ -303,7 +303,7 @@ fn parse_iter_usage<'tcx>(
303303 None
304304 } ;
305305 } ,
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) => {
307307 if let Some ( Constant :: Int ( idx) ) = ConstEvalCtxt :: new ( cx) . eval ( idx_expr) {
308308 let span = if name. ident . as_str ( ) == "nth" {
309309 e. span
@@ -312,7 +312,7 @@ fn parse_iter_usage<'tcx>(
312312 && next_name. ident . name == sym:: next
313313 && next_expr. span . ctxt ( ) == ctxt
314314 && 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)
316316 {
317317 next_expr. span
318318 } else {
0 commit comments