about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/context.rs
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-07-02 00:57:59 +0200
committerSamuel Tardieu <sam@rfc1149.net>2025-07-02 11:50:25 +0200
commitb4d35fde7e2b7a08eafc537344ed861132e8bf50 (patch)
tree6a64805a3a9b19e72000553df13c4717e0855b18 /compiler/rustc_lint/src/context.rs
parent71e4c005caa812a16fcb08d0bf1e6f1eda7c8381 (diff)
downloadrust-b4d35fde7e2b7a08eafc537344ed861132e8bf50.tar.gz
rust-b4d35fde7e2b7a08eafc537344ed861132e8bf50.zip
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/rustc_lint/src/context.rs')
-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,