@@ -98,6 +98,7 @@ fn validate_diag(diag: &Diag<'_, impl EmissionGuarantee>) {
98
98
/// 17 | std::mem::forget(seven);
99
99
/// | ^^^^^^^^^^^^^^^^^^^^^^^
100
100
/// ```
101
+ #[ track_caller]
101
102
pub fn span_lint < T : LintContext > ( cx : & T , lint : & ' static Lint , sp : impl Into < MultiSpan > , msg : impl Into < DiagMessage > ) {
102
103
#[ expect( clippy:: disallowed_methods) ]
103
104
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
143
144
/// |
144
145
/// = help: consider using `f64::NAN` if you would like a constant representing NaN
145
146
/// ```
147
+ #[ track_caller]
146
148
pub fn span_lint_and_help < T : LintContext > (
147
149
cx : & T ,
148
150
lint : & ' static Lint ,
@@ -203,6 +205,7 @@ pub fn span_lint_and_help<T: LintContext>(
203
205
/// 10 | forget(&SomeStruct);
204
206
/// | ^^^^^^^^^^^
205
207
/// ```
208
+ #[ track_caller]
206
209
pub fn span_lint_and_note < T : LintContext > (
207
210
cx : & T ,
208
211
lint : & ' static Lint ,
@@ -244,6 +247,7 @@ pub fn span_lint_and_note<T: LintContext>(
244
247
/// If you're unsure which function you should use, you can test if the `#[expect]` attribute works
245
248
/// where you would expect it to.
246
249
/// If it doesn't, you likely need to use [`span_lint_hir_and_then`] instead.
250
+ #[ track_caller]
247
251
pub fn span_lint_and_then < C , S , M , F > ( cx : & C , lint : & ' static Lint , sp : S , msg : M , f : F )
248
252
where
249
253
C : LintContext ,
@@ -286,6 +290,7 @@ where
286
290
/// Instead, use this function and also pass the `HirId` of `<expr_1>`, which will let
287
291
/// the compiler check lint level attributes at the place of the expression and
288
292
/// the `#[allow]` will work.
293
+ #[ track_caller]
289
294
pub fn span_lint_hir ( cx : & LateContext < ' _ > , lint : & ' static Lint , hir_id : HirId , sp : Span , msg : impl Into < DiagMessage > ) {
290
295
#[ expect( clippy:: disallowed_methods) ]
291
296
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
321
326
/// Instead, use this function and also pass the `HirId` of `<expr_1>`, which will let
322
327
/// the compiler check lint level attributes at the place of the expression and
323
328
/// the `#[allow]` will work.
329
+ #[ track_caller]
324
330
pub fn span_lint_hir_and_then (
325
331
cx : & LateContext < ' _ > ,
326
332
lint : & ' static Lint ,
@@ -374,6 +380,7 @@ pub fn span_lint_hir_and_then(
374
380
/// = note: `-D fold-any` implied by `-D warnings`
375
381
/// ```
376
382
#[ cfg_attr( not( debug_assertions) , expect( clippy:: collapsible_span_lint_calls) ) ]
383
+ #[ track_caller]
377
384
pub fn span_lint_and_sugg < T : LintContext > (
378
385
cx : & T ,
379
386
lint : & ' static Lint ,
0 commit comments