std::file! [] [src]

macro_rules! file { () => ({ /* compiler built-in */ }) }

A macro which expands to the file name from which it was invoked.

The expanded expression has type &'static str`&'static str, and the returned file is not the invocation of the`, and the returned file is not the invocation of the file!()`file!()macro itself, but rather the first macro invocation leading up to the invocation of the` macro itself, but rather the first macro invocation leading up to the invocation of the file!()`file!()` macro.

Examples

fn main() { let this_file = file!(); println!("defined in file: {}", this_file); }
let this_file = file!();
println!("defined in file: {}", this_file);