Open lnicola opened 3 years ago
This part in rustc is quite ambitious :
This one works:
macro_rules! m{
{{
#[doc=r"abcde"]
}
} => { }
}
m!({/**abcde*/});
fn main() {}
This one doesn't works:
macro_rules! m{
{{
/**abcde*/
}
} => { }
}
m!({/**abcde*/});
fn main() {}
This one works:
macro_rules! m{
{{
/***/
}
} => { }
}
m!({/***/});
fn main() {}
This one doesn't work:
macro_rules! m{
{{
///
}
} => { }
}
m!({
///
});
fn main() {}
(ノಠ益ಠ)ノ彡┻━┻
Might be worth asking in #t-compiler
.
I didn't realize that features! {}
actually works with my updated example.
And we also seem to expose the #[doc]
desugaring:
I didn't realize that features! {} actually works with my updated example.
The second branch couldn't be matched because of the "NEON" and the comma.
And we also seem to expose the #[doc] desugaring:
Yes, we desugar all doc comment in mbe included empty one, and that's why we failed because we expect a doc comment in macro invocation.
This one doesn't work: ``` macro_rules! m{ {{ /// } } => { } } m!({ /// }); fn main() {} ```
I did guess that rustc doesn't desugar ///
into #[doc = "..."]
inside the macro rules matcher.
Adapted from
ring
.