You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!();
The text was updated successfully, but these errors were encountered:
I don't think paste fits here, afaik the doc comment expects a &str, and the result of paste is an identifier.
I was wrong and it seems this is related to proc_macros expansion, and there is an unstable feature to expand macros that resolve to literals: rust-lang/rust#90765
You can just use concat! here, which does eager macro expansion:
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.The text was updated successfully, but these errors were encountered: