macro_rules! location {
    () => { ... };
}
Expand description

Produces a Location when invoked in a function body.

use async_backtrace::{location, Location};

#[tokio::main]
async fn main() {
    assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at src/location.rs:7:16");

    async {
        assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at src/location.rs:10:20");
    }.await;
     
    (|| async {
        assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at src/location.rs:14:20");
    })().await;
}