Closed
Description
rust-analyzer version: 0.3.1489-standalone (bc78ebd 2023-04-23)
rustc version: 1.69.0 (84c898d65 2023-04-16)
I'm trying to use this method for generating dynamic doc within macros:
macro_rules! my_func {
($method:ident, $name:tt) => {
#[doc = concat!("This is ", stringify!($name), ".")]
pub fn $method() {}
};
}
my_func!(foo, "foo");
/// This documentation shows up.
fn another() {}
fn main() {
foo();
another();
}
Notice the use of concat!
and stringify!
to generate the documentation dynamically.
Screenshot 1:
Screenshot 2: