Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.
This repository was archived by the owner on Oct 6, 2024. It is now read-only.

#[doc] does not concat if a macro produces a literal string #99

@chanced

Description

@chanced

I'm incredibly new to macros so I don't know if this is even possible to address.

If a macro that produces a string literal is used in #[doc], paste does not concat.

macro_rules! create_string {
    () => {
        "example"
    };
}
macro_rules! example {
    () => {
        paste::paste! {
            #[doc = create_string!() "example"]
            fn example(){}
        }
    };
}
error: expected one of `.`, `?`, `]`, or an operator, found `"example"`
  --> sandbox/src/lib.rs:20:38
   |
20 |             #[doc = create_string!() "example"]
   |                                      ^^^^^^^^^ expected one of `.`, `?`, `]`, or an operator
...
26 | example!();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions