diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-23 20:09:11 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-23 20:40:25 +0300 |
| commit | c00f5af4d6e709cb23f9d47ceb466c13a073f7b5 (patch) | |
| tree | 78b05b5d6bdc3249fcb85f859b8c35b276b634af /src/libsyntax | |
| parent | fffe9fbb5134da7ce77660dfc4562b5e395853e8 (diff) | |
hygiene: Do not reset expansion info for `quote!`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index b7f4bc61435..e8fad1a2177 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -597,7 +597,11 @@ pub enum SyntaxExtension { MultiModifier(Box<MultiItemModifier + sync::Sync + sync::Send>), /// A function-like procedural macro. TokenStream -> TokenStream. - ProcMacro(Box<ProcMacro + sync::Sync + sync::Send>, Edition), + ProcMacro( + /* expander: */ Box<ProcMacro + sync::Sync + sync::Send>, + /* allow_internal_unstable: */ bool, + /* edition: */ Edition, + ), /// An attribute-like procedural macro. TokenStream, TokenStream -> TokenStream. /// The first TokenSteam is the attribute, the second is the annotated item. diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index eb26bdc74b5..8ad6e32f42d 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -804,7 +804,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { kind.dummy(span) } - ProcMacro(ref expandfun, edition) => { + ProcMacro(ref expandfun, allow_internal_unstable, edition) => { if ident.name != keywords::Invalid.name() { let msg = format!("macro {}! expects no ident argument, given '{}'", path, ident); @@ -821,7 +821,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { // yet, when they do, we should use it here. span: None, // FIXME probably want to follow macro_rules macros here. - allow_internal_unstable: false, + allow_internal_unstable, allow_internal_unsafe: false, edition, }, |
