about summary refs log tree commit diff
path: root/clippy_lints
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-22 22:35:21 +0000
committerbors <bors@rust-lang.org>2022-06-22 22:35:21 +0000
commit6985e6592b36d49d2a0ae4184d44f82d4b763fb5 (patch)
treeb50390b24a38735d476585529d49e571e486ed54 /clippy_lints
parent3d366fc2d8ab854adab6936c9d5d7b2cf929ae96 (diff)
parent4a4b5cf06153d8e8702ea5105d777d4822871edf (diff)
downloadrust-6985e6592b36d49d2a0ae4184d44f82d4b763fb5.tar.gz
rust-6985e6592b36d49d2a0ae4184d44f82d4b763fb5.zip
Auto merge of #9028 - kyoto7250:issue_8798, r=xFrednet
confirm  using chain in collapsible_span_lint_calls

close #8798

This PR fixes false positive when using chain in `collapsible_span_lint_calls`.

changelog: None
Diffstat (limited to 'clippy_lints')
-rw-r--r--clippy_lints/src/utils/internal_lints.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs
index b885e5132f1..36a85b0869f 100644
--- a/clippy_lints/src/utils/internal_lints.rs
+++ b/clippy_lints/src/utils/internal_lints.rs
@@ -668,6 +668,7 @@ impl<'tcx> LateLintPass<'tcx> for CollapsibleCalls {
             let body = cx.tcx.hir().body(*body);
             let only_expr = peel_blocks_with_stmt(&body.value);
             if let ExprKind::MethodCall(ps, span_call_args, _) = &only_expr.kind;
+            if let ExprKind::Path(..) = span_call_args[0].kind;
             then {
                 let and_then_snippets = get_and_then_snippets(cx, and_then_args);
                 let mut sle = SpanlessEq::new(cx).deny_side_effects();