Description
This is a tracking issue for the RFC "Implicit caller location" (rust-lang/rfcs#2091).
Steps:
- Implement the RFC (cc @rust-lang/compiler -- can anyone write up mentoring instructions?)
- Adjust documentation (see instructions on forge)
- Stabilization PR (see instructions on forge)
Unresolved questions:
-
If we want to support adding#[track_caller]
to trait methods, the redirection
pass/query/whatever should be placed after monomorphization, not before. Currently the RFC
simply prohibits applying#[track_caller]
to trait methods as a future-proofing measure. -
Diverging functions should be supported. -
The closurefoo::{{closure}}
should inherit most attributes applied to the functionfoo
, in
particular#[inline]
,#[cold]
,#[naked]
and also the ABI. Currently a procedural macro
won't see any of these, nor would there be anyway to apply these attributes to a closure.
Therefore,#[rustc_implicit_caller_location]
currently will reject#[naked]
and ABI, and
leaving#[inline]
and#[cold]
mean no-op. There is no semantic reason why these cannot be
used though.