pub fn file_from_location<'a>(loc: &'a Location<'a>) -> &'a CStrExpand description
Gets the C string file name of a Location.
If Location::file_as_c_str() is not available, returns a string that warns about it.
ยงExamples
#[track_caller]
fn foo() {
    let caller = core::panic::Location::caller();
    // Output:
    // - A path like "rust/kernel/example.rs" if `file_as_c_str()` is available.
    // - "<Location::file_as_c_str() not supported>" otherwise.
    let caller_file = file_from_location(caller);
    // Prints out the message with caller's file name.
    pr_info!("foo() called in file {caller_file:?}\n");
}