@@ -526,7 +526,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Loops {
526
526
let pat = & arms[ 0 ] . pat . kind ;
527
527
if let (
528
528
& PatKind :: TupleStruct ( ref qpath, ref pat_args, _) ,
529
- & ExprKind :: MethodCall ( ref method_path, _, ref method_args) ,
529
+ & ExprKind :: MethodCall ( ref method_path, _, ref method_args, _ ) ,
530
530
) = ( pat, & match_expr. kind )
531
531
{
532
532
let iter_expr = & method_args[ 0 ] ;
@@ -654,7 +654,7 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
654
654
| ExprKind :: Struct ( _, _, Some ( ref e) )
655
655
| ExprKind :: Repeat ( ref e, _)
656
656
| ExprKind :: DropTemps ( ref e) => never_loop_expr ( e, main_loop_id) ,
657
- ExprKind :: Array ( ref es) | ExprKind :: MethodCall ( _, _, ref es) | ExprKind :: Tup ( ref es) => {
657
+ ExprKind :: Array ( ref es) | ExprKind :: MethodCall ( _, _, ref es, _ ) | ExprKind :: Tup ( ref es) => {
658
658
never_loop_expr_all ( & mut es. iter ( ) , main_loop_id)
659
659
} ,
660
660
ExprKind :: Call ( ref e, ref es) => never_loop_expr_all ( & mut once ( & * * e) . chain ( es. iter ( ) ) , main_loop_id) ,
@@ -806,7 +806,7 @@ fn is_slice_like<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'_>) -> bool {
806
806
807
807
fn fetch_cloned_expr < ' tcx > ( expr : & ' tcx Expr < ' tcx > ) -> & ' tcx Expr < ' tcx > {
808
808
if_chain ! {
809
- if let ExprKind :: MethodCall ( method, _, args) = expr. kind;
809
+ if let ExprKind :: MethodCall ( method, _, args, _ ) = expr. kind;
810
810
if method. ident. name == sym!( clone) ;
811
811
if args. len( ) == 1 ;
812
812
if let Some ( arg) = args. get( 0 ) ;
@@ -915,7 +915,7 @@ fn build_manual_memcpy_suggestion<'a, 'tcx>(
915
915
916
916
let print_limit = |end : & Expr < ' _ > , offset : Offset , var : & Expr < ' _ > | {
917
917
if_chain ! {
918
- if let ExprKind :: MethodCall ( method, _, len_args) = end. kind;
918
+ if let ExprKind :: MethodCall ( method, _, len_args, _ ) = end. kind;
919
919
if method. ident. name == sym!( len) ;
920
920
if len_args. len( ) == 1 ;
921
921
if let Some ( arg) = len_args. get( 0 ) ;
@@ -1190,7 +1190,7 @@ fn check_for_loop_range<'a, 'tcx>(
1190
1190
1191
1191
fn is_len_call ( expr : & Expr < ' _ > , var : Name ) -> bool {
1192
1192
if_chain ! {
1193
- if let ExprKind :: MethodCall ( ref method, _, ref len_args) = expr. kind;
1193
+ if let ExprKind :: MethodCall ( ref method, _, ref len_args, _ ) = expr. kind;
1194
1194
if len_args. len( ) == 1 ;
1195
1195
if method. ident. name == sym!( len) ;
1196
1196
if let ExprKind :: Path ( QPath :: Resolved ( _, ref path) ) = len_args[ 0 ] . kind;
@@ -1244,7 +1244,7 @@ fn lint_iter_method(cx: &LateContext<'_, '_>, args: &[Expr<'_>], arg: &Expr<'_>,
1244
1244
1245
1245
fn check_for_loop_arg ( cx : & LateContext < ' _ , ' _ > , pat : & Pat < ' _ > , arg : & Expr < ' _ > , expr : & Expr < ' _ > ) {
1246
1246
let mut next_loop_linted = false ; // whether or not ITER_NEXT_LOOP lint was used
1247
- if let ExprKind :: MethodCall ( ref method, _, ref args) = arg. kind {
1247
+ if let ExprKind :: MethodCall ( ref method, _, ref args, _ ) = arg. kind {
1248
1248
// just the receiver, no arguments
1249
1249
if args. len ( ) == 1 {
1250
1250
let method_name = & * method. ident . as_str ( ) ;
@@ -1718,7 +1718,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1718
1718
fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
1719
1719
if_chain ! {
1720
1720
// a range index op
1721
- if let ExprKind :: MethodCall ( ref meth, _, ref args) = expr. kind;
1721
+ if let ExprKind :: MethodCall ( ref meth, _, ref args, _ ) = expr. kind;
1722
1722
if ( meth. ident. name == sym!( index) && match_trait_method( self . cx, expr, & paths:: INDEX ) )
1723
1723
|| ( meth. ident. name == sym!( index_mut) && match_trait_method( self . cx, expr, & paths:: INDEX_MUT ) ) ;
1724
1724
if !self . check( & args[ 1 ] , & args[ 0 ] , expr) ;
@@ -1776,7 +1776,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1776
1776
self . visit_expr ( expr) ;
1777
1777
}
1778
1778
} ,
1779
- ExprKind :: MethodCall ( _, _, args) => {
1779
+ ExprKind :: MethodCall ( _, _, args, _ ) => {
1780
1780
let def_id = self . cx . tables . type_dependent_def_id ( expr. hir_id ) . unwrap ( ) ;
1781
1781
for ( ty, expr) in self . cx . tcx . fn_sig ( def_id) . inputs ( ) . skip_binder ( ) . iter ( ) . zip ( args) {
1782
1782
self . prefer_mutable = false ;
@@ -2369,8 +2369,8 @@ const NEEDLESS_COLLECT_MSG: &str = "avoid using `collect()` when not needed";
2369
2369
2370
2370
fn check_needless_collect < ' a , ' tcx > ( expr : & ' tcx Expr < ' _ > , cx : & LateContext < ' a , ' tcx > ) {
2371
2371
if_chain ! {
2372
- if let ExprKind :: MethodCall ( ref method, _, ref args) = expr. kind;
2373
- if let ExprKind :: MethodCall ( ref chain_method, _, _) = args[ 0 ] . kind;
2372
+ if let ExprKind :: MethodCall ( ref method, _, ref args, _ ) = expr. kind;
2373
+ if let ExprKind :: MethodCall ( ref chain_method, _, _, _ ) = args[ 0 ] . kind;
2374
2374
if chain_method. ident. name == sym!( collect) && match_trait_method( cx, & args[ 0 ] , & paths:: ITERATOR ) ;
2375
2375
if let Some ( ref generic_args) = chain_method. args;
2376
2376
if let Some ( GenericArg :: Type ( ref ty) ) = generic_args. args. get( 0 ) ;
@@ -2437,7 +2437,7 @@ fn check_needless_collect<'a, 'tcx>(expr: &'tcx Expr<'_>, cx: &LateContext<'a, '
2437
2437
2438
2438
fn shorten_span ( expr : & Expr < ' _ > , target_fn_name : Symbol ) -> Span {
2439
2439
let mut current_expr = expr;
2440
- while let ExprKind :: MethodCall ( ref path, ref span, ref args) = current_expr. kind {
2440
+ while let ExprKind :: MethodCall ( ref path, ref span, ref args, _ ) = current_expr. kind {
2441
2441
if path. ident . name == target_fn_name {
2442
2442
return expr. span . with_lo ( span. lo ( ) ) ;
2443
2443
}
0 commit comments