about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-02 19:29:39 +0200
committerGitHub <noreply@github.com>2025-07-02 19:29:39 +0200
commitbc8bcc7e8a9d4caf6405c3a2edc1a607df8340e9 (patch)
tree50bdd2b67d6061ed827c8531f89c4eed860b0552 /compiler
parent0617a9eb95388fa7b925fadd42357b8ae2a59d35 (diff)
parentb4d35fde7e2b7a08eafc537344ed861132e8bf50 (diff)
downloadrust-bc8bcc7e8a9d4caf6405c3a2edc1a607df8340e9.tar.gz
rust-bc8bcc7e8a9d4caf6405c3a2edc1a607df8340e9.zip
Rollup merge of #143306 - samueltardieu:track-clippy-lints-emission, r=petrochenkov
Add `track_caller` attributes to trace origin of Clippy lints

This allows the use of `-Z track-diagnostics` to see the origin of Clippy lints emission, as is already the case for lints coming from rustc.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint/src/context.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs
index 95663204ec3..b694d3dd49b 100644
--- a/compiler/rustc_lint/src/context.rs
+++ b/compiler/rustc_lint/src/context.rs
@@ -504,6 +504,7 @@ pub trait LintContext {
     ///
     /// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature
     #[rustc_lint_diagnostics]
+    #[track_caller]
     fn opt_span_lint<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,
@@ -542,6 +543,7 @@ pub trait LintContext {
     ///
     /// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature
     #[rustc_lint_diagnostics]
+    #[track_caller]
     fn span_lint<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,