Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkov

Expand macros in `extern {}` blocks

This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature.

A tracking issue is now open at #49476

closes #48747
This commit is contained in:
Alex Crichton
2018-04-05 10:49:14 -05:00
committed by GitHub
31 changed files with 544 additions and 65 deletions

View File

@@ -2192,6 +2192,8 @@ pub enum ForeignItemKind {
Static(P<Ty>, bool),
/// A foreign type
Ty,
/// A macro invocation
Macro(Mac),
}
impl ForeignItemKind {
@@ -2200,6 +2202,7 @@ impl ForeignItemKind {
ForeignItemKind::Fn(..) => "foreign function",
ForeignItemKind::Static(..) => "foreign static item",
ForeignItemKind::Ty => "foreign type",
ForeignItemKind::Macro(..) => "macro in foreign module",
}
}
}