Skip to content

Commit 1eb9f48

Browse files
committed
Declare lint.
1 parent 1b259b0 commit 1eb9f48

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
@@ -142,6 +142,12 @@ declare_clippy_lint! {
142142
"found 'default lint description' in a lint declaration"
143143
}
144144

145+
declare_clippy_lint! {
146+
pub COLLAPSIBLE_SPAN_LINT_CALLS,
147+
internal,
148+
"found collapsible `span_lint_and_then` calls"
149+
}
150+
145151
declare_lint_pass!(ClippyLintsInternal => [CLIPPY_LINTS_INTERNAL]);
146152

147153
impl EarlyLintPass for ClippyLintsInternal {
@@ -391,3 +397,11 @@ fn is_trigger_fn(fn_kind: FnKind<'_>) -> bool {
391397
FnKind::Closure(..) => false,
392398
}
393399
}
400+
401+
declare_lint_pass!(CollapsibleCalls => [COLLAPSIBLE_SPAN_LINT_CALLS]);
402+
403+
impl EarlyLintPass for CollapsibleCalls {
404+
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {
405+
span_lint_and_help(cx, COLLAPSIBLE_SPAN_LINT_CALLS, expr.span, "lint_message", "help_message");
406+
}
407+
}

0 commit comments

Comments
 (0)