diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-12-01 11:17:50 -0600 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2022-01-21 07:48:10 -0600 |
| commit | 82f613ee3b12a6a90bd9e99fbbab947674d6ec7a (patch) | |
| tree | 2fdbde82c588d076843603f65b1580f4b3674539 /clippy_lints/src/utils | |
| parent | ec00cf80a306abe59e99ffdb4bfcc55b022fc5b7 (diff) | |
Remove a span from hir::ExprKind::MethodCall
Diffstat (limited to 'clippy_lints/src/utils')
| -rw-r--r-- | clippy_lints/src/utils/author.rs | 4 | ||||
| -rw-r--r-- | clippy_lints/src/utils/inspector.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/utils/internal_lints.rs | 6 | ||||
| -rw-r--r-- | clippy_lints/src/utils/internal_lints/metadata_collector.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 1d7bb243026..d23c85c033b 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -402,9 +402,9 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> { self.expr(func); self.slice(args, |e| self.expr(e)); }, - ExprKind::MethodCall(method_name, _, args, _) => { + ExprKind::MethodCall(method_name, args, _) => { bind!(self, method_name, args); - kind!("MethodCall({method_name}, _, {args}, _)"); + kind!("MethodCall({method_name}, {args}, _)"); self.ident(field!(method_name.ident)); self.slice(args, |e| self.expr(e)); }, diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 89eae06fef7..b58325ac73e 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -149,7 +149,7 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) { } print_expr(cx, init, indent + 1); }, - hir::ExprKind::MethodCall(path, _, args, _) => { + hir::ExprKind::MethodCall(path, args, _) => { println!("{}MethodCall", ind); println!("{}method name: {}", ind, path.ident.name); for arg in args { diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index 02fa866db52..ec1b5a499d4 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -583,7 +583,7 @@ impl<'tcx> LateLintPass<'tcx> for CompilerLintFunctions { } if_chain! { - if let ExprKind::MethodCall(path, _, [self_arg, ..], _) = &expr.kind; + if let ExprKind::MethodCall(path, [self_arg, ..], _) = &expr.kind; let fn_name = path.ident; if let Some(sugg) = self.map.get(&*fn_name.as_str()); let ty = cx.typeck_results().expr_ty(self_arg).peel_refs(); @@ -665,7 +665,7 @@ impl<'tcx> LateLintPass<'tcx> for CollapsibleCalls { if let ExprKind::Closure(_, _, body_id, _, _) = &and_then_args[4].kind; let body = cx.tcx.hir().body(*body_id); let only_expr = peel_blocks_with_stmt(&body.value); - if let ExprKind::MethodCall(ps, _, span_call_args, _) = &only_expr.kind; + if let ExprKind::MethodCall(ps, span_call_args, _) = &only_expr.kind; then { let and_then_snippets = get_and_then_snippets(cx, and_then_args); let mut sle = SpanlessEq::new(cx).deny_side_effects(); @@ -1097,7 +1097,7 @@ impl InterningDefinedSymbol { }; if_chain! { // is a method call - if let ExprKind::MethodCall(_, _, [item], _) = call.kind; + if let ExprKind::MethodCall(_, [item], _) = call.kind; if let Some(did) = cx.typeck_results().type_dependent_def_id(call.hir_id); let ty = cx.typeck_results().expr_ty(item); // ...on either an Ident or a Symbol diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 8485c14bfe7..5ee3146eaab 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -896,7 +896,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for IsMultiSpanScanner<'a, 'hir> { self.add_single_span_suggestion(); } }, - ExprKind::MethodCall(path, _path_span, arg, _arg_span) => { + ExprKind::MethodCall(path, arg, _arg_span) => { let (self_ty, _) = walk_ptrs_ty_depth(self.cx.typeck_results().expr_ty(&arg[0])); if match_type(self.cx, self_ty, &paths::DIAGNOSTIC_BUILDER) { let called_method = path.ident.name.as_str().to_string(); |
