-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support macro expansion inside attribute #8092
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 |
e.g :
It is unstable feature and it is used in rustc master already.
The text was updated successfully, but these errors were encountered: