-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize core::panic::Location::caller #72448
Comments
@rfcbot fcp merge |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Was a decision ever reached on #69977? It's currently impossible to determine which method call in a chain (e.g. |
That's only true if a library wants to programatically inspect the caller, right? It's possible to use |
I don’t think any action was decided upon here. I think we can “enhance” the |
This is correct, for custom error types to get the improved panic messages earlier, we could stabilize the attribute separately from the intrinsic wrapper. This seems like a good option to exercise if there are concerns about this FCP which wouldn’t block the attribute from stabilizing, as it would decouple schedule pressures. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Does this mean that 'span start' info (currently |
Why shouldn’t each call in a chain have its own span? |
AIUI there’s a limitation in how MIR propagates spans in method chains but @eddyb should correct me. |
I would expect that to change if the Location type became aware of span start/ends, or if MIR becomes able to more accurately provide a span start within the middle of the chain. This doesn't seem problematic to me in general but that's operating from the assumption that changes to span reporting wouldn't be breaking changes. Maybe that assumption is in error? |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Can this issue be closed now that |
The lang FCP for
#[track_caller]
is happening in #72445. This is a libs FCP for https://doc.rust-lang.org/nightly/std/panic/struct.Location.html#method.caller which is under the same feature gate and required for making use of#[track_caller]
in library code.Refer to @anp's stabilization report and the method's example code.
In particular:
The return type is
&'static Location<'static>
which resembles the return type of std::panic::PanicInfo::location (Option<&'a Location<'a>>
) but static and non-optional.The location points to the outermost call site not inside of a
#[track_caller]
function.@rust-lang/libs
The text was updated successfully, but these errors were encountered: