Macro fn_name::instantiated
source · [−]macro_rules! instantiated {
() => { ... };
}
Expand description
Produces the name of the surrounding function or method, including instantiated generics (if any).
Example
struct GenericType<A>(A);
impl<A> GenericType<A> {
fn generic_method<B>(self, _: B) -> &'static str {
fn_name::instantiated!()
}
}
fn main() {
assert_eq!(
GenericType(42u8).generic_method(false),
"GenericType<u8>::generic_method<bool>"
);
}