Rollup merge of #68072 - JohnTitor:fix-macro-ice, r=petrochenkov
Fix ICE #68058 Fixes #68058 r? @petrochenkov
This commit is contained in:
commit
f02f338ee0
@ -202,7 +202,12 @@ pub(super) fn lower_expr_mut(&mut self, e: &Expr) -> hir::Expr<'hir> {
|
||||
ExprKind::Mac(_) => panic!("Shouldn't exist here"),
|
||||
};
|
||||
|
||||
hir::Expr { hir_id: self.lower_node_id(e.id), kind, span: e.span, attrs: e.attrs.clone() }
|
||||
hir::Expr {
|
||||
hir_id: self.lower_node_id(e.id),
|
||||
kind,
|
||||
span: e.span,
|
||||
attrs: e.attrs.iter().map(|a| self.lower_attr(a)).collect::<Vec<_>>().into(),
|
||||
}
|
||||
}
|
||||
|
||||
fn lower_unop(&mut self, u: UnOp) -> hir::UnOp {
|
||||
|
14
src/test/ui/macros/issue-68058.rs
Normal file
14
src/test/ui/macros/issue-68058.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// check-pass
|
||||
|
||||
macro_rules! foo {
|
||||
($doc: expr) => {
|
||||
fn f() {
|
||||
#[doc = $doc]
|
||||
()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
foo!("doc");
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user