-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support macro expansion inside attribute #8092
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
cc #7779 |
I guess this is related to #7049 |
This would be very useful for generating macro_rules! impl_foo {
($name:ident, $sname:expr) => {
#[doc = "Returns a new `"]
#[doc = $sname]
#[doc = "`."]
pub fn myfoo() -> $name {
42
}
};
($name:tt) => {
impl_foo!($name, stringify!($name));
};
}
impl_foo!(u32); Currently, the above doc gets rendered as
instead of
|
A workaround: Have a Tedious, and it requires an extra |
Since this is still an issue and I havent seen it mentioned anywhere, this depended on the now stable
This has been a stable feature for years, std and many other crates rely on it for their documentation, and more continue to as time goes on, and rust-analyzer doesn't render docs using it correctly |
…23072) rust-analyzer does not support derive_macro expansion in attributes - rust-lang/rust-analyzer#8092. This could be worked around via a proc_macro, but I think it'd be best to just require docs for every action. Release Notes: - N/A
e.g :
It is unstable feature and it is used in rustc master already.
The text was updated successfully, but these errors were encountered: