Function core::intrinsics::caller_location [−][src]
pub extern "rust-intrinsic" fn caller_location(
) -> &'static Location<'static>🔬 This is a nightly-only experimental API. (core_intrinsics)
intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
Expand description
获取对静态 Location 的引用,以指示在何处调用了它。
请注意,与大多数内部函数不同,这对调用是安全的;
它不需要 unsafe 块。
因此,实现不得要求用户维护任何安全不变量。
可以考虑使用 core::panic::Location::caller。