@@ -13,6 +13,7 @@ use rustc_middle::{
13
13
ty:: { self , FloatTy , IntTy , PolyFnSig , Ty } ,
14
14
} ;
15
15
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
16
+ use std:: iter;
16
17
17
18
declare_clippy_lint ! {
18
19
/// **What it does:** Checks for usage of unconstrained numeric literals which may cause default numeric fallback in type
@@ -107,7 +108,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
107
108
match & expr. kind {
108
109
ExprKind :: Call ( func, args) => {
109
110
if let Some ( fn_sig) = fn_sig_opt ( self . cx , func. hir_id ) {
110
- for ( expr, bound) in args . iter ( ) . zip ( fn_sig. skip_binder ( ) . inputs ( ) . iter ( ) ) {
111
+ for ( expr, bound) in iter:: zip ( * args , fn_sig. skip_binder ( ) . inputs ( ) ) {
111
112
// Push found arg type, then visit arg.
112
113
self . ty_bounds . push ( TyBound :: Ty ( bound) ) ;
113
114
self . visit_expr ( expr) ;
@@ -120,7 +121,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
120
121
ExprKind :: MethodCall ( _, _, args, _) => {
121
122
if let Some ( def_id) = self . cx . typeck_results ( ) . type_dependent_def_id ( expr. hir_id ) {
122
123
let fn_sig = self . cx . tcx . fn_sig ( def_id) . skip_binder ( ) ;
123
- for ( expr, bound) in args . iter ( ) . zip ( fn_sig. inputs ( ) . iter ( ) ) {
124
+ for ( expr, bound) in iter:: zip ( * args , fn_sig. inputs ( ) ) {
124
125
self . ty_bounds . push ( TyBound :: Ty ( bound) ) ;
125
126
self . visit_expr ( expr) ;
126
127
self . ty_bounds . pop ( ) ;
0 commit comments