This issue is similar to #161961.
Related tracking issue: #110011
I tried this code:
struct Thing;
trait Trait {
#[track_caller]
async fn method(&self);
}
impl Trait for Thing {
async fn method(&self) {
panic!();
}
}
#[tokio::main]
async fn main() {
Thing.method().await;
}
This code should either produce a warning, or the panic should point to the line where method is called and awaited.
Instead, this code does not produce any warnings, and the panic points to the line where panic!() was written. Adding #![feature(async_fn_track_caller)] to the top doesn't change this behavior.
This is incorrect, as the reference says that #[track_caller] on a function in a trait definition should apply to that function in all impl blocks.
Also, there should probably be an ungated_async_fn_track_caller FCW for this code.
Meta
Reproducible on the playground with version 1.101.0-nightly (2026-09-26 75a75c3e0a67d3fa3d03)
This issue is similar to #161961.
Related tracking issue: #110011
I tried this code:
This code should either produce a warning, or the panic should point to the line where
methodis called and awaited.Instead, this code does not produce any warnings, and the panic points to the line where
panic!()was written. Adding#![feature(async_fn_track_caller)]to the top doesn't change this behavior.This is incorrect, as the reference says that
#[track_caller]on a function in a trait definition should apply to that function in all impl blocks.Also, there should probably be an
ungated_async_fn_track_callerFCW for this code.Meta
Reproducible on the playground with version
1.101.0-nightly (2026-09-26 75a75c3e0a67d3fa3d03)