about summary refs log tree commit diff
path: root/src/tools/clippy
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2023-12-15 14:08:16 -0800
committerGitHub <noreply@github.com>2023-12-15 14:08:16 -0800
commit58353fa45834b650f1b7c5089fd48dde099b082d (patch)
treef378a5f57918137ed3f6f708fd68c2af3d381e47 /src/tools/clippy
parent1d54949765e88e70ae9df91d545fc7e5a6dbe016 (diff)
parent252d99a54b44208295d5f6eb6f6443e65acbd0dd (diff)
downloadrust-58353fa45834b650f1b7c5089fd48dde099b082d.tar.gz
rust-58353fa45834b650f1b7c5089fd48dde099b082d.zip
Rollup merge of #118727 - compiler-errors:lint-decorate, r=WaffleLapkin
Don't pass lint back out of lint decorator

Change the decorator function in the signature of the `emit_lint`/`span_lint`/etc family of methods from `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` to `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>)`. I consider it easier to read this way, especially when there's control flow involved.

r? nnethercote though feel free to reassign
Diffstat (limited to 'src/tools/clippy')
-rw-r--r--src/tools/clippy/clippy_utils/src/diagnostics.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/tools/clippy/clippy_utils/src/diagnostics.rs b/src/tools/clippy/clippy_utils/src/diagnostics.rs
index fa56e5b0ba2..7562961538e 100644
--- a/src/tools/clippy/clippy_utils/src/diagnostics.rs
+++ b/src/tools/clippy/clippy_utils/src/diagnostics.rs
@@ -49,7 +49,6 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
     #[expect(clippy::disallowed_methods)]
     cx.struct_span_lint(lint, sp, msg.to_string(), |diag| {
         docs_link(diag, lint);
-        diag
     });
 }
 
@@ -90,7 +89,6 @@ pub fn span_lint_and_help<T: LintContext>(
             diag.help(help.to_string());
         }
         docs_link(diag, lint);
-        diag
     });
 }
 
@@ -134,7 +132,6 @@ pub fn span_lint_and_note<T: LintContext>(
             diag.note(note);
         }
         docs_link(diag, lint);
-        diag
     });
 }
 
@@ -152,7 +149,6 @@ where
     cx.struct_span_lint(lint, sp, msg.to_string(), |diag| {
         f(diag);
         docs_link(diag, lint);
-        diag
     });
 }
 
@@ -160,7 +156,6 @@ pub fn span_lint_hir(cx: &LateContext<'_>, lint: &'static Lint, hir_id: HirId, s
     #[expect(clippy::disallowed_methods)]
     cx.tcx.struct_span_lint_hir(lint, hir_id, sp, msg.to_string(), |diag| {
         docs_link(diag, lint);
-        diag
     });
 }
 
@@ -176,7 +171,6 @@ pub fn span_lint_hir_and_then(
     cx.tcx.struct_span_lint_hir(lint, hir_id, sp, msg.to_string(), |diag| {
         f(diag);
         docs_link(diag, lint);
-        diag
     });
 }