method_name 0.3.1

macro that expands to the name of the annotated function
Documentation
#[macro_use]
extern crate method_name;

macro_rules! function_path {
    () => {
        concat!(module_path!(), "::", method_name!())
    };
}

pub mod foo {
    pub mod bar {
        #[named]
        pub fn baz() {
            dbg!(function_path!());
        }
    }
}

fn main() {
    foo::bar::baz();
}