In C and C++ you can get the name of the currently executing function through the __func__
macro with C99 & C++11 and ___FUNCTION___
for MSVC.
Is there an equivalent of this in Rust?
Example of __func__
in C:
#include "stdio.h"
void funny_hello() {
printf ("Hello from %s\n", __func__);
}
int main() {
funny_hello();
}
Outputs Hello from funny_hello
.