about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/builtin.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-06-21 11:29:05 +0200
committerJana Dönszelmann <jana@donsz.nl>2025-06-24 23:00:31 +0200
commit5d44fdd972ee555b499c21068a03a5b3d88b1c7e (patch)
treec2c3c2c746c891fc46cc8422ad20e7cb86297367 /compiler/rustc_lint/src/builtin.rs
parent3129d37ef7075ee3cbaa3d6cbe1b5794f67192b0 (diff)
downloadrust-5d44fdd972ee555b499c21068a03a5b3d88b1c7e.tar.gz
rust-5d44fdd972ee555b499c21068a03a5b3d88b1c7e.zip
Rewrite #[track_caller]
Diffstat (limited to 'compiler/rustc_lint/src/builtin.rs')
-rw-r--r--compiler/rustc_lint/src/builtin.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index ac405277c4e..5bbe69c8d65 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -1184,11 +1184,11 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller {
         if fn_kind.asyncness().is_async()
             && !cx.tcx.features().async_fn_track_caller()
             // Now, check if the function has the `#[track_caller]` attribute
-            && let Some(attr) = cx.tcx.get_attr(def_id, sym::track_caller)
+            && let Some(attr_span) = find_attr!(cx.tcx.get_all_attrs(def_id), AttributeKind::TrackCaller(span) => *span)
         {
             cx.emit_span_lint(
                 UNGATED_ASYNC_FN_TRACK_CALLER,
-                attr.span(),
+                attr_span,
                 BuiltinUngatedAsyncFnTrackCaller { label: span, session: &cx.tcx.sess },
             );
         }