Skip to content

Commit 82f613e

Browse files
committed
Remove a span from hir::ExprKind::MethodCall
1 parent ec00cf8 commit 82f613e

File tree

91 files changed

+162
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+162
-168
lines changed

clippy_lints/src/blocks_in_if_conditions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
5959
// do not lint if the closure is called using an iterator (see #1141)
6060
if_chain! {
6161
if let Some(parent) = get_parent_expr(self.cx, expr);
62-
if let ExprKind::MethodCall(_, _, [self_arg, ..], _) = &parent.kind;
62+
if let ExprKind::MethodCall(_, [self_arg, ..], _) = &parent.kind;
6363
let caller = self.cx.typeck_results().expr_ty(self_arg);
6464
if let Some(iter_id) = self.cx.tcx.get_diagnostic_item(sym::Iterator);
6565
if implements_trait(self.cx, caller, iter_id, &[]);

clippy_lints/src/booleans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn simplify_not(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<String> {
259259
))
260260
})
261261
},
262-
ExprKind::MethodCall(path, _, args, _) if args.len() == 1 => {
262+
ExprKind::MethodCall(path, args, _) if args.len() == 1 => {
263263
let type_of_receiver = cx.typeck_results().expr_ty(&args[0]);
264264
if !is_type_diagnostic_item(cx, type_of_receiver, sym::Option)
265265
&& !is_type_diagnostic_item(cx, type_of_receiver, sym::Result)

clippy_lints/src/bytecount.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ declare_lint_pass!(ByteCount => [NAIVE_BYTECOUNT]);
4141
impl<'tcx> LateLintPass<'tcx> for ByteCount {
4242
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
4343
if_chain! {
44-
if let ExprKind::MethodCall(count, _, [count_recv], _) = expr.kind;
44+
if let ExprKind::MethodCall(count, [count_recv], _) = expr.kind;
4545
if count.ident.name == sym::count;
46-
if let ExprKind::MethodCall(filter, _, [filter_recv, filter_arg], _) = count_recv.kind;
46+
if let ExprKind::MethodCall(filter, [filter_recv, filter_arg], _) = count_recv.kind;
4747
if filter.ident.name == sym!(filter);
4848
if let ExprKind::Closure(_, _, body_id, _, _) = filter_arg.kind;
4949
let body = cx.tcx.hir().body(body_id);
@@ -68,7 +68,7 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
6868
if ty::Uint(UintTy::U8) == *cx.typeck_results().expr_ty(needle).peel_refs().kind();
6969
if !is_local_used(cx, needle, arg_id);
7070
then {
71-
let haystack = if let ExprKind::MethodCall(path, _, args, _) =
71+
let haystack = if let ExprKind::MethodCall(path, args, _) =
7272
filter_recv.kind {
7373
let p = path.ident.name;
7474
if (p == sym::iter || p == sym!(iter_mut)) && args.len() == 1 {

clippy_lints/src/case_sensitive_file_extension_comparisons.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare_lint_pass!(CaseSensitiveFileExtensionComparisons => [CASE_SENSITIVE_FILE
3737

3838
fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &Expr<'_>) -> Option<Span> {
3939
if_chain! {
40-
if let ExprKind::MethodCall(PathSegment { ident, .. }, _, [obj, extension, ..], span) = expr.kind;
40+
if let ExprKind::MethodCall(PathSegment { ident, .. }, [obj, extension, ..], span) = expr.kind;
4141
if ident.as_str() == "ends_with";
4242
if let ExprKind::Lit(Spanned { node: LitKind::Str(ext_literal, ..), ..}) = extension.kind;
4343
if (2..=6).contains(&ext_literal.as_str().len());

clippy_lints/src/casts/cast_possible_truncation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn apply_reductions(cx: &LateContext<'_>, nbits: u64, expr: &Expr<'_>, signed: b
4343
},
4444
_ => nbits,
4545
},
46-
ExprKind::MethodCall(method, _, [left, right], _) => {
46+
ExprKind::MethodCall(method, [left, right], _) => {
4747
if signed {
4848
return nbits;
4949
}
@@ -54,7 +54,7 @@ fn apply_reductions(cx: &LateContext<'_>, nbits: u64, expr: &Expr<'_>, signed: b
5454
};
5555
apply_reductions(cx, nbits, left, signed).min(max_bits.unwrap_or(u64::max_value()))
5656
},
57-
ExprKind::MethodCall(method, _, [_, lo, hi], _) => {
57+
ExprKind::MethodCall(method, [_, lo, hi], _) => {
5858
if method.ident.as_str() == "clamp" {
5959
//FIXME: make this a diagnostic item
6060
if let (Some(lo_bits), Some(hi_bits)) = (get_constant_bits(cx, lo), get_constant_bits(cx, hi)) {
@@ -63,7 +63,7 @@ fn apply_reductions(cx: &LateContext<'_>, nbits: u64, expr: &Expr<'_>, signed: b
6363
}
6464
nbits
6565
},
66-
ExprKind::MethodCall(method, _, [_value], _) => {
66+
ExprKind::MethodCall(method, [_value], _) => {
6767
if method.ident.name.as_str() == "signum" {
6868
0 // do not lint if cast comes from a `signum` function
6969
} else {

clippy_lints/src/casts/cast_ptr_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
1919
cx.typeck_results().expr_ty(expr),
2020
);
2121
lint_cast_ptr_alignment(cx, expr, cast_from, cast_to);
22-
} else if let ExprKind::MethodCall(method_path, _, [self_arg, ..], _) = &expr.kind {
22+
} else if let ExprKind::MethodCall(method_path, [self_arg, ..], _) = &expr.kind {
2323
if_chain! {
2424
if method_path.ident.name == sym!(cast);
2525
if let Some(generic_args) = method_path.args;

clippy_lints/src/casts/cast_sign_loss.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ fn should_lint(cx: &LateContext<'_>, cast_op: &Expr<'_>, cast_from: Ty<'_>, cast
4141
}
4242

4343
// Don't lint for the result of methods that always return non-negative values.
44-
if let ExprKind::MethodCall(path, _, _, _) = cast_op.kind {
44+
if let ExprKind::MethodCall(path, _, _) = cast_op.kind {
4545
let mut method_name = path.ident.name.as_str();
4646
let allowed_methods = ["abs", "checked_abs", "rem_euclid", "checked_rem_euclid"];
4747

4848
if_chain! {
4949
if method_name == "unwrap";
5050
if let Some(arglist) = method_chain_args(cast_op, &["unwrap"]);
51-
if let ExprKind::MethodCall(inner_path, _, _, _) = &arglist[0][0].kind;
51+
if let ExprKind::MethodCall(inner_path, _, _) = &arglist[0][0].kind;
5252
then {
5353
method_name = inner_path.ident.name.as_str();
5454
}

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
131131
}
132132
},
133133

134-
ExprKind::MethodCall(_, _, args, _) => {
134+
ExprKind::MethodCall(_, args, _) => {
135135
if let Some(def_id) = self.cx.typeck_results().type_dependent_def_id(expr.hir_id) {
136136
let fn_sig = self.cx.tcx.fn_sig(def_id).skip_binder();
137137
for (expr, bound) in iter::zip(*args, fn_sig.inputs()) {

clippy_lints/src/dereference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn try_parse_ref_op<'tcx>(
361361
expr: &'tcx Expr<'_>,
362362
) -> Option<(RefOp, &'tcx Expr<'tcx>)> {
363363
let (def_id, arg) = match expr.kind {
364-
ExprKind::MethodCall(_, _, [arg], _) => (typeck.type_dependent_def_id(expr.hir_id)?, arg),
364+
ExprKind::MethodCall(_, [arg], _) => (typeck.type_dependent_def_id(expr.hir_id)?, arg),
365365
ExprKind::Call(
366366
Expr {
367367
kind: ExprKind::Path(path),
@@ -408,7 +408,7 @@ fn is_linted_explicit_deref_position(parent: Option<Node<'_>>, child_id: HirId,
408408
match parent.kind {
409409
// Leave deref calls in the middle of a method chain.
410410
// e.g. x.deref().foo()
411-
ExprKind::MethodCall(_, _, [self_arg, ..], _) if self_arg.hir_id == child_id => false,
411+
ExprKind::MethodCall(_, [self_arg, ..], _) if self_arg.hir_id == child_id => false,
412412

413413
// Leave deref calls resulting in a called function
414414
// e.g. (x.deref())()

clippy_lints/src/duration_subsec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for DurationSubsec {
4545
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
4646
if_chain! {
4747
if let ExprKind::Binary(Spanned { node: BinOpKind::Div, .. }, left, right) = expr.kind;
48-
if let ExprKind::MethodCall(method_path, _ , args, _) = left.kind;
48+
if let ExprKind::MethodCall(method_path, args, _) = left.kind;
4949
if match_type(cx, cx.typeck_results().expr_ty(&args[0]).peel_refs(), &paths::DURATION);
5050
if let Some((Constant::Int(divisor), _)) = constant(cx, cx.typeck_results(), right);
5151
then {

clippy_lints/src/entry.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ fn try_parse_contains<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Optio
244244
});
245245
match expr.kind {
246246
ExprKind::MethodCall(
247-
_,
248247
_,
249248
[
250249
map,
@@ -281,7 +280,7 @@ struct InsertExpr<'tcx> {
281280
value: &'tcx Expr<'tcx>,
282281
}
283282
fn try_parse_insert<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<InsertExpr<'tcx>> {
284-
if let ExprKind::MethodCall(_, _, [map, key, value], _) = expr.kind {
283+
if let ExprKind::MethodCall(_, [map, key, value], _) = expr.kind {
285284
let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?;
286285
if match_def_path(cx, id, &paths::BTREEMAP_INSERT) || match_def_path(cx, id, &paths::HASHMAP_INSERT) {
287286
Some(InsertExpr { map, key, value })

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
144144
);
145145

146146
if_chain!(
147-
if let ExprKind::MethodCall(path, _, args, _) = body.value.kind;
147+
if let ExprKind::MethodCall(path, args, _) = body.value.kind;
148148
if check_inputs(cx, body.params, args);
149149
let method_def_id = cx.typeck_results().type_dependent_def_id(body.value.hir_id).unwrap();
150150
let substs = cx.typeck_results().node_substs(body.value.hir_id);

clippy_lints/src/explicit_write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitWrite {
3535
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
3636
if_chain! {
3737
// match call to unwrap
38-
if let ExprKind::MethodCall(unwrap_fun, _, [write_call], _) = expr.kind;
38+
if let ExprKind::MethodCall(unwrap_fun, [write_call], _) = expr.kind;
3939
if unwrap_fun.ident.name == sym::unwrap;
4040
// match call to write_fmt
41-
if let ExprKind::MethodCall(write_fun, _, [write_recv, write_arg], _) = write_call.kind;
41+
if let ExprKind::MethodCall(write_fun, [write_recv, write_arg], _) = write_call.kind;
4242
if write_fun.ident.name == sym!(write_fmt);
4343
// match calls to std::io::stdout() / std::io::stderr ()
4444
if let Some(dest_name) = if match_function_call(cx, write_recv, &paths::STDOUT).is_some() {

clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn check_powi(cx: &LateContext<'_>, expr: &Expr<'_>, args: &[Expr<'_>]) {
303303
if value == Int(2) {
304304
if let Some(parent) = get_parent_expr(cx, expr) {
305305
if let Some(grandparent) = get_parent_expr(cx, parent) {
306-
if let ExprKind::MethodCall(PathSegment { ident: method_name, .. }, _, args, _) = grandparent.kind {
306+
if let ExprKind::MethodCall(PathSegment { ident: method_name, .. }, args, _) = grandparent.kind {
307307
if method_name.as_str() == "sqrt" && detect_hypot(cx, args).is_some() {
308308
return;
309309
}
@@ -364,13 +364,11 @@ fn detect_hypot(cx: &LateContext<'_>, args: &[Expr<'_>]) -> Option<String> {
364364
if_chain! {
365365
if let ExprKind::MethodCall(
366366
PathSegment { ident: lmethod_name, .. },
367-
_lspan,
368367
[largs_0, largs_1, ..],
369368
_
370369
) = &add_lhs.kind;
371370
if let ExprKind::MethodCall(
372371
PathSegment { ident: rmethod_name, .. },
373-
_rspan,
374372
[rargs_0, rargs_1, ..],
375373
_
376374
) = &add_rhs.kind;
@@ -409,7 +407,7 @@ fn check_expm1(cx: &LateContext<'_>, expr: &Expr<'_>) {
409407
if cx.typeck_results().expr_ty(lhs).is_floating_point();
410408
if let Some((value, _)) = constant(cx, cx.typeck_results(), rhs);
411409
if F32(1.0) == value || F64(1.0) == value;
412-
if let ExprKind::MethodCall(path, _, [self_arg, ..], _) = &lhs.kind;
410+
if let ExprKind::MethodCall(path, [self_arg, ..], _) = &lhs.kind;
413411
if cx.typeck_results().expr_ty(self_arg).is_floating_point();
414412
if path.ident.name.as_str() == "exp";
415413
then {
@@ -453,7 +451,7 @@ fn check_mul_add(cx: &LateContext<'_>, expr: &Expr<'_>) {
453451
) = &expr.kind
454452
{
455453
if let Some(parent) = get_parent_expr(cx, expr) {
456-
if let ExprKind::MethodCall(PathSegment { ident: method_name, .. }, _, args, _) = parent.kind {
454+
if let ExprKind::MethodCall(PathSegment { ident: method_name, .. }, args, _) = parent.kind {
457455
if method_name.as_str() == "sqrt" && detect_hypot(cx, args).is_some() {
458456
return;
459457
}
@@ -589,8 +587,8 @@ fn check_custom_abs(cx: &LateContext<'_>, expr: &Expr<'_>) {
589587

590588
fn are_same_base_logs(cx: &LateContext<'_>, expr_a: &Expr<'_>, expr_b: &Expr<'_>) -> bool {
591589
if_chain! {
592-
if let ExprKind::MethodCall(PathSegment { ident: method_name_a, .. }, _, args_a, _) = expr_a.kind;
593-
if let ExprKind::MethodCall(PathSegment { ident: method_name_b, .. }, _, args_b, _) = expr_b.kind;
590+
if let ExprKind::MethodCall(PathSegment { ident: method_name_a, .. }, args_a, _) = expr_a.kind;
591+
if let ExprKind::MethodCall(PathSegment { ident: method_name_b, .. }, args_b, _) = expr_b.kind;
594592
then {
595593
return method_name_a.as_str() == method_name_b.as_str() &&
596594
args_a.len() == args_b.len() &&
@@ -615,8 +613,8 @@ fn check_log_division(cx: &LateContext<'_>, expr: &Expr<'_>) {
615613
rhs,
616614
) = &expr.kind;
617615
if are_same_base_logs(cx, lhs, rhs);
618-
if let ExprKind::MethodCall(_, _, [largs_self, ..], _) = &lhs.kind;
619-
if let ExprKind::MethodCall(_, _, [rargs_self, ..], _) = &rhs.kind;
616+
if let ExprKind::MethodCall(_, [largs_self, ..], _) = &lhs.kind;
617+
if let ExprKind::MethodCall(_, [rargs_self, ..], _) = &rhs.kind;
620618
then {
621619
span_lint_and_sugg(
622620
cx,
@@ -714,7 +712,7 @@ impl<'tcx> LateLintPass<'tcx> for FloatingPointArithmetic {
714712
return;
715713
}
716714

717-
if let ExprKind::MethodCall(path, _, args, _) = &expr.kind {
715+
if let ExprKind::MethodCall(path, args, _) = &expr.kind {
718716
let recv_ty = cx.typeck_results().expr_ty(&args[0]);
719717

720718
if recv_ty.is_floating_point() {

clippy_lints/src/format_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symb
149149
fn check_to_string_in_format_args(cx: &LateContext<'_>, name: Symbol, value: &Expr<'_>) {
150150
if_chain! {
151151
if !value.span.from_expansion();
152-
if let ExprKind::MethodCall(_, _, [receiver], _) = value.kind;
152+
if let ExprKind::MethodCall(_, [receiver], _) = value.kind;
153153
if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(value.hir_id);
154154
if is_diag_trait_item(cx, method_def_id, sym::ToString);
155155
let receiver_ty = cx.typeck_results().expr_ty(receiver);

clippy_lints/src/functions/must_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
217217
return;
218218
}
219219
match expr.kind {
220-
Call(_, args) | MethodCall(_, _, args, _) => {
220+
Call(_, args) | MethodCall(_, args, _) => {
221221
let mut tys = DefIdSet::default();
222222
for arg in args {
223223
if self.cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())

clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
8888
}
8989
}
9090
},
91-
hir::ExprKind::MethodCall(_, _, args, _) => {
91+
hir::ExprKind::MethodCall(_, args, _) => {
9292
let def_id = self.typeck_results.type_dependent_def_id(expr.hir_id).unwrap();
9393
let base_type = self.cx.tcx.type_of(def_id);
9494

clippy_lints/src/get_last_with_len.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'tcx> LateLintPass<'tcx> for GetLastWithLen {
5151
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
5252
if_chain! {
5353
// Is a method call
54-
if let ExprKind::MethodCall(path, _, args, _) = expr.kind;
54+
if let ExprKind::MethodCall(path, args, _) = expr.kind;
5555

5656
// Method name is "get"
5757
if path.ident.name == sym!(get);
@@ -73,7 +73,7 @@ impl<'tcx> LateLintPass<'tcx> for GetLastWithLen {
7373
) = &get_index_arg.kind;
7474

7575
// LHS of subtraction is "x.len()"
76-
if let ExprKind::MethodCall(arg_lhs_path, _, lhs_args, _) = &lhs.kind;
76+
if let ExprKind::MethodCall(arg_lhs_path, lhs_args, _) = &lhs.kind;
7777
if arg_lhs_path.ident.name == sym::len;
7878
if let Some(arg_lhs_struct) = lhs_args.get(0);
7979

clippy_lints/src/if_let_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'tcx, 'l> ArmVisitor<'tcx, 'l> {
127127

128128
fn is_mutex_lock_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> {
129129
if_chain! {
130-
if let ExprKind::MethodCall(path, _span, [self_arg, ..], _) = &expr.kind;
130+
if let ExprKind::MethodCall(path, [self_arg, ..], _) = &expr.kind;
131131
if path.ident.as_str() == "lock";
132132
let ty = cx.typeck_results().expr_ty(self_arg);
133133
if is_type_diagnostic_item(cx, ty, sym::Mutex);

clippy_lints/src/infinite_iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const HEURISTICS: [(&str, usize, Heuristic, Finiteness); 19] = [
145145

146146
fn is_infinite(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {
147147
match expr.kind {
148-
ExprKind::MethodCall(method, _, args, _) => {
148+
ExprKind::MethodCall(method, args, _) => {
149149
for &(name, len, heuristic, cap) in &HEURISTICS {
150150
if method.ident.name.as_str() == name && args.len() == len {
151151
return (match heuristic {
@@ -221,7 +221,7 @@ const INFINITE_COLLECTORS: &[Symbol] = &[
221221

222222
fn complete_infinite_iter(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {
223223
match expr.kind {
224-
ExprKind::MethodCall(method, _, args, _) => {
224+
ExprKind::MethodCall(method, args, _) => {
225225
for &(name, len) in &COMPLETING_METHODS {
226226
if method.ident.name.as_str() == name && args.len() == len {
227227
return is_infinite(cx, &args[0]);

clippy_lints/src/len_zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ fn check_for_is_empty(
370370
}
371371

372372
fn check_cmp(cx: &LateContext<'_>, span: Span, method: &Expr<'_>, lit: &Expr<'_>, op: &str, compare_to: u32) {
373-
if let (&ExprKind::MethodCall(method_path, _, args, _), &ExprKind::Lit(ref lit)) = (&method.kind, &lit.kind) {
373+
if let (&ExprKind::MethodCall(method_path, args, _), &ExprKind::Lit(ref lit)) = (&method.kind, &lit.kind) {
374374
// check if we are in an is_empty() method
375375
if let Some(name) = get_item_name(cx, method) {
376376
if name.as_str() == "is_empty" {

clippy_lints/src/loops/manual_memcpy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn build_manual_memcpy_suggestion<'tcx>(
119119

120120
let print_limit = |end: &Expr<'_>, end_str: &str, base: &Expr<'_>, sugg: MinifyingSugg<'static>| {
121121
if_chain! {
122-
if let ExprKind::MethodCall(method, _, len_args, _) = end.kind;
122+
if let ExprKind::MethodCall(method, len_args, _) = end.kind;
123123
if method.ident.name == sym::len;
124124
if len_args.len() == 1;
125125
if let Some(arg) = len_args.get(0);
@@ -343,7 +343,7 @@ fn get_slice_like_element_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Opti
343343

344344
fn fetch_cloned_expr<'tcx>(expr: &'tcx Expr<'tcx>) -> &'tcx Expr<'tcx> {
345345
if_chain! {
346-
if let ExprKind::MethodCall(method, _, args, _) = expr.kind;
346+
if let ExprKind::MethodCall(method, args, _) = expr.kind;
347347
if method.ident.name == sym::clone;
348348
if args.len() == 1;
349349
if let Some(arg) = args.get(0);

clippy_lints/src/loops/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ fn check_for_loop<'tcx>(
658658
fn check_for_loop_arg(cx: &LateContext<'_>, pat: &Pat<'_>, arg: &Expr<'_>) {
659659
let mut next_loop_linted = false; // whether or not ITER_NEXT_LOOP lint was used
660660

661-
if let ExprKind::MethodCall(method, _, [self_arg], _) = arg.kind {
661+
if let ExprKind::MethodCall(method, [self_arg], _) = arg.kind {
662662
let method_name = method.ident.as_str();
663663
// check for looping over x.iter() or x.iter_mut(), could use &x or &mut x
664664
match method_name {

0 commit comments

Comments
 (0)