diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-06 21:10:16 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-10 21:19:40 +0300 |
| commit | 97f4e700c20ccc95f4e9ed3d2c9d368cbc4be445 (patch) | |
| tree | b31a6f1c369fccd6605f8f683548c1677cdbec0a /src/libsyntax/ext/base.rs | |
| parent | a73ecb3d9c432f8f53117b1a6b6c209dc802dee7 (diff) | |
| download | rust-97f4e700c20ccc95f4e9ed3d2c9d368cbc4be445.tar.gz rust-97f4e700c20ccc95f4e9ed3d2c9d368cbc4be445.zip | |
syntax: Remove `SyntaxExtension::IdentTT` and `IdentMacroExpander`
Diffstat (limited to 'src/libsyntax/ext/base.rs')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 61c736662c7..ffc32127924 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -288,34 +288,6 @@ impl<F> TTMacroExpander for F } } -pub trait IdentMacroExpander { - fn expand<'cx>(&self, - cx: &'cx mut ExtCtxt<'_>, - sp: Span, - ident: ast::Ident, - token_tree: Vec<tokenstream::TokenTree>) - -> Box<dyn MacResult+'cx>; -} - -pub type IdentMacroExpanderFn = - for<'cx> fn(&'cx mut ExtCtxt<'_>, Span, ast::Ident, Vec<tokenstream::TokenTree>) - -> Box<dyn MacResult+'cx>; - -impl<F> IdentMacroExpander for F - where F : for<'cx> Fn(&'cx mut ExtCtxt<'_>, Span, ast::Ident, - Vec<tokenstream::TokenTree>) -> Box<dyn MacResult+'cx> -{ - fn expand<'cx>(&self, - cx: &'cx mut ExtCtxt<'_>, - sp: Span, - ident: ast::Ident, - token_tree: Vec<tokenstream::TokenTree>) - -> Box<dyn MacResult+'cx> - { - (*self)(cx, sp, ident, token_tree) - } -} - // Use a macro because forwarding to a simple function has type system issues macro_rules! make_stmts_default { ($me:expr) => { @@ -658,14 +630,6 @@ pub enum SyntaxExtension { edition: Edition, }, - /// A function-like syntax extension that has an extra ident before - /// the block. - IdentTT { - expander: Box<dyn IdentMacroExpander + sync::Sync + sync::Send>, - span: Option<Span>, - allow_internal_unstable: Option<Lrc<[Symbol]>>, - }, - /// An attribute-like procedural macro. TokenStream -> TokenStream. /// The input is the annotated item. /// Allows generating code to implement a Trait for a given struct @@ -691,7 +655,6 @@ impl SyntaxExtension { match *self { SyntaxExtension::DeclMacro { .. } | SyntaxExtension::NormalTT { .. } | - SyntaxExtension::IdentTT { .. } | SyntaxExtension::ProcMacro { .. } => MacroKind::Bang, SyntaxExtension::NonMacroAttr { .. } | @@ -725,7 +688,6 @@ impl SyntaxExtension { SyntaxExtension::ProcMacroDerive(.., edition) => edition, // Unstable legacy stuff SyntaxExtension::NonMacroAttr { .. } | - SyntaxExtension::IdentTT { .. } | SyntaxExtension::MultiDecorator(..) | SyntaxExtension::MultiModifier(..) | SyntaxExtension::BuiltinDerive(..) => default_edition, |
