Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc in macro with concat! and stringify! won't show up #14684

Closed
rodrigocfd opened this issue Apr 29, 2023 · 1 comment
Closed

Doc in macro with concat! and stringify! won't show up #14684

rodrigocfd opened this issue Apr 29, 2023 · 1 comment
Labels
A-ide general IDE features A-macro macro expansion C-bug Category: bug

Comments

@rodrigocfd
Copy link

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:

no-show

Screenshot 2:

yes-show

@rodrigocfd rodrigocfd added the C-bug Category: bug label Apr 29, 2023
@lnicola lnicola added A-macro macro expansion A-ide general IDE features labels Apr 29, 2023
@Veykril
Copy link
Member

Veykril commented Apr 29, 2023

Duplicate of #8092

@Veykril Veykril marked this as a duplicate of #8092 Apr 29, 2023
@Veykril Veykril closed this as completed Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features A-macro macro expansion C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants