@@ -98,6 +98,7 @@ fn validate_diag(diag: &Diag<'_, impl EmissionGuarantee>) {
9898/// 17 | std::mem::forget(seven);
9999/// | ^^^^^^^^^^^^^^^^^^^^^^^
100100/// ```
101+ #[ track_caller]
101102pub fn span_lint < T : LintContext > ( cx : & T , lint : & ' static Lint , sp : impl Into < MultiSpan > , msg : impl Into < DiagMessage > ) {
102103 #[ expect( clippy:: disallowed_methods) ]
103104 cx. span_lint ( lint, sp, |diag| {
@@ -143,6 +144,7 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
143144/// |
144145/// = help: consider using `f64::NAN` if you would like a constant representing NaN
145146/// ```
147+ #[ track_caller]
146148pub fn span_lint_and_help < T : LintContext > (
147149 cx : & T ,
148150 lint : & ' static Lint ,
@@ -203,6 +205,7 @@ pub fn span_lint_and_help<T: LintContext>(
203205/// 10 | forget(&SomeStruct);
204206/// | ^^^^^^^^^^^
205207/// ```
208+ #[ track_caller]
206209pub fn span_lint_and_note < T : LintContext > (
207210 cx : & T ,
208211 lint : & ' static Lint ,
@@ -244,6 +247,7 @@ pub fn span_lint_and_note<T: LintContext>(
244247/// If you're unsure which function you should use, you can test if the `#[expect]` attribute works
245248/// where you would expect it to.
246249/// If it doesn't, you likely need to use [`span_lint_hir_and_then`] instead.
250+ #[ track_caller]
247251pub fn span_lint_and_then < C , S , M , F > ( cx : & C , lint : & ' static Lint , sp : S , msg : M , f : F )
248252where
249253 C : LintContext ,
@@ -286,6 +290,7 @@ where
286290/// Instead, use this function and also pass the `HirId` of `<expr_1>`, which will let
287291/// the compiler check lint level attributes at the place of the expression and
288292/// the `#[allow]` will work.
293+ #[ track_caller]
289294pub fn span_lint_hir ( cx : & LateContext < ' _ > , lint : & ' static Lint , hir_id : HirId , sp : Span , msg : impl Into < DiagMessage > ) {
290295 #[ expect( clippy:: disallowed_methods) ]
291296 cx. tcx . node_span_lint ( lint, hir_id, sp, |diag| {
@@ -321,6 +326,7 @@ pub fn span_lint_hir(cx: &LateContext<'_>, lint: &'static Lint, hir_id: HirId, s
321326/// Instead, use this function and also pass the `HirId` of `<expr_1>`, which will let
322327/// the compiler check lint level attributes at the place of the expression and
323328/// the `#[allow]` will work.
329+ #[ track_caller]
324330pub fn span_lint_hir_and_then (
325331 cx : & LateContext < ' _ > ,
326332 lint : & ' static Lint ,
@@ -374,6 +380,7 @@ pub fn span_lint_hir_and_then(
374380/// = note: `-D fold-any` implied by `-D warnings`
375381/// ```
376382#[ cfg_attr( not( debug_assertions) , expect( clippy:: collapsible_span_lint_calls) ) ]
383+ #[ track_caller]
377384pub fn span_lint_and_sugg < T : LintContext > (
378385 cx : & T ,
379386 lint : & ' static Lint ,
0 commit comments