mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
confirm using chain in collapsible_span_lint_calls
This commit is contained in:
parent
e933bb6bc3
commit
4a4b5cf061
@ -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 New Issue
Block a user