The current implementation of #[track_caller] allows trait methods to have the annotation, including at their definition site. When applied in a trait definition, the attribute has effect on all impls. @eddyb raised the question in code review of whether you should also be able to add the attribute without adding an implementation as part of a specialization chain.
To me this seems like the correct semantics given what we'd like the non-specialized behavior to be. It's probably a little complicated to implement.
The current implementation of
#[track_caller]allows trait methods to have the annotation, including at their definition site. When applied in a trait definition, the attribute has effect on all impls. @eddyb raised the question in code review of whether you should also be able to add the attribute without adding an implementation as part of a specialization chain.To me this seems like the correct semantics given what we'd like the non-specialized behavior to be. It's probably a little complicated to implement.