Closed
Description
macro_rules! doc_comment {
($x:expr) => {
#[doc = $x]
extern {
}};}
macro_rules! some_macro {
($t1: ty) => {
doc_comment!{format!("{coor}", coor = stringify!($t1)).as_str()
}}}
fn main() {
some_macro!(u8);
}
Expected result: The compiler does not crash.
Actual result: The compiler crashes, and asks for the crash to be reported as a bug.
Workaround: Using concat!() instead of format!()
Likely cause: concat!() returns a &str, whereas format!() returns a String.
Metadata
Metadata
Assignees
Labels
No labels