Creating a doc
attribute from stringify!
or concat!
in a macro works in some situations but not others
#52607
Labels
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Summary
Although creating a
doc
attribute directly from astringify!
(orconcat!
) does not work, i.e.,fails with
it is possible to use a macro in some situations. For example, this code compiles correctly
and
rustdoc
creates the correct documentation.Code demonstrating the issue
The error message is similar to the one at the top of this report.
If the
stringify!(Bug)
is replaced with"Bug"
, the code compiles correctly.All of the above holds true if you replace
stringify!
withconcat!
.Expectation
I'd expect the second and third code samples above to either both produce an error message or neither. (Preferably, neither.)
Versions
Both stable (rustc 1.27.2 (58cc626 2018-07-18)) and nightly (rustc 1.29.0-nightly (874dec2 2018-07-21)) have the same behavior.
The text was updated successfully, but these errors were encountered: