mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-28 07:30:57 +00:00
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
This commit is contained in:
commit
6985e6592b
3 changed files with 13 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -45,7 +45,12 @@ impl EarlyLintPass for Pass {
|
|||
if predicate {
|
||||
db.note(note_msg);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// Issue #8798
|
||||
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
|
||||
db.help(help_msg).help(help_msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,12 @@ impl EarlyLintPass for Pass {
|
|||
if predicate {
|
||||
db.note(note_msg);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// Issue #8798
|
||||
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
|
||||
db.help(help_msg).help(help_msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue