Skip to content

Commit c86a7e5

Browse files
committed
Misc doc updates
1 parent 332c2dc commit c86a7e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clippy_lints/src/utils/diagnostics.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
5151
///
5252
/// The `help` message can be optionally attached to a `Span`.
5353
///
54+
/// If you change the signature, remember to update the internal lint `CollapsibleCalls`
55+
///
5456
/// # Example
5557
///
5658
/// ```ignore
@@ -87,6 +89,8 @@ pub fn span_lint_and_help<'a, T: LintContext>(
8789
/// The `note` message is presented separately from the main lint message
8890
/// and is attached to a specific span:
8991
///
92+
/// If you change the signature, remember to update the internal lint `CollapsibleCalls`
93+
///
9094
/// # Example
9195
///
9296
/// ```ignore
@@ -126,6 +130,7 @@ pub fn span_lint_and_note<'a, T: LintContext>(
126130
/// Like `span_lint` but allows to add notes, help and suggestions using a closure.
127131
///
128132
/// If you need to customize your lint output a lot, use this function.
133+
/// If you change the signature, remember to update the internal lint `CollapsibleCalls`
129134
pub fn span_lint_and_then<'a, T: LintContext, F>(cx: &'a T, lint: &'static Lint, sp: Span, msg: &str, f: F)
130135
where
131136
F: for<'b> FnOnce(&mut DiagnosticBuilder<'b>),
@@ -168,6 +173,10 @@ pub fn span_lint_hir_and_then(
168173
/// In the example below, `help` is `"try"` and `sugg` is the suggested replacement `".any(|x| x >
169174
/// 2)"`.
170175
///
176+
/// If you change the signature, remember to update the internal lint `CollapsibleCalls`
177+
///
178+
/// # Example
179+
///
171180
/// ```ignore
172181
/// error: This `.fold` can be more succinctly expressed as `.any`
173182
/// --> $DIR/methods.rs:390:13

doc/common_tools_writing_lints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl LateLintPass<'_> for MyStructLint {
6060
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
6161
if_chain! {
6262
// Check our expr is calling a method
63-
if let hir::ExprKind::MethodCall(path, _, _args) = &expr.kind;
63+
if let hir::ExprKind::MethodCall(path, _, _args, _) = &expr.kind;
6464
// Check the name of this method is `some_method`
6565
if path.ident.name == sym!(some_method);
6666
then {

0 commit comments

Comments
 (0)