Closed
Description
In Unstable Book the section const_caller_location leads to a closed tracking issue #47809 about a general caller tracking. There is a forked new issue about tracking callers for closures, but it seems unrelated to working in const functions.
This functionality is still not stabilized, because trying to use it like this:
#[track_caller]
const fn foo() -> &'static std::panic::Location<'static> {
std::panic::Location::caller()
}
gives error:
error: `std::panic::Location::<'a>::caller` is not yet stable as a const fn
--> src/lib.rs:3:5
|
3 | std::panic::Location::caller()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_caller_location)]` to the crate attributes to enable
Thus it looks like const_caller_location
should have its own tracking issue.
Metadata
Metadata
Assignees
Labels
No labels