Skip to content

Commit b3a82d6

Browse files
committed
Declare lint.
1 parent 8ba553c commit b3a82d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

clippy_lints/src/utils/internal_lints.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ declare_clippy_lint! {
144144
"found 'default lint description' in a lint declaration"
145145
}
146146

147+
declare_clippy_lint! {
148+
pub COLLAPSIBLE_SPAN_LINT_CALLS,
149+
internal,
150+
"found collapsible `span_lint_and_then` calls"
151+
}
152+
147153
declare_lint_pass!(ClippyLintsInternal => [CLIPPY_LINTS_INTERNAL]);
148154

149155
impl EarlyLintPass for ClippyLintsInternal {
@@ -395,3 +401,11 @@ fn is_trigger_fn(fn_kind: FnKind<'_>) -> bool {
395401
FnKind::Closure(..) => false,
396402
}
397403
}
404+
405+
declare_lint_pass!(CollapsibleCalls => [COLLAPSIBLE_SPAN_LINT_CALLS]);
406+
407+
impl EarlyLintPass for CollapsibleCalls {
408+
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {
409+
span_lint_and_help(cx, COLLAPSIBLE_SPAN_LINT_CALLS, expr.span, "lint_message", "help_message");
410+
}
411+
}

0 commit comments

Comments
 (0)