diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-09-01 13:16:03 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-09-01 13:16:03 +1200 |
| commit | 20e1ea2dd84d5b29414059a4e07ce7327d1bef19 (patch) | |
| tree | 7f03d7977c2b89ed097d6a938db2e0260e06da2a /src/libsyntax/ext/base.rs | |
| parent | 8f28c9b01ee5ff7e73bb81b3364f26b6ad4060a2 (diff) | |
| download | rust-20e1ea2dd84d5b29414059a4e07ce7327d1bef19.tar.gz rust-20e1ea2dd84d5b29414059a4e07ce7327d1bef19.zip | |
Remove the Modifier and Decorator kinds of syntax extensions.
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
Diffstat (limited to 'src/libsyntax/ext/base.rs')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index ef49ef11497..775d47a8c0e 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -31,60 +31,6 @@ use std::collections::HashMap; use std::rc::Rc; use std::default::Default; -#[unstable(feature = "rustc_private")] -#[deprecated(since = "1.0.0", reason = "replaced by MultiItemDecorator")] -pub trait ItemDecorator { - fn expand(&self, - ecx: &mut ExtCtxt, - sp: Span, - meta_item: &ast::MetaItem, - item: &ast::Item, - push: &mut FnMut(P<ast::Item>)); -} - -#[allow(deprecated)] -#[unstable(feature = "rustc_private")] -#[deprecated(since = "1.0.0", reason = "replaced by MultiItemDecorator")] -impl<F> ItemDecorator for F - where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &ast::Item, &mut FnMut(P<ast::Item>)) -{ - fn expand(&self, - ecx: &mut ExtCtxt, - sp: Span, - meta_item: &ast::MetaItem, - item: &ast::Item, - push: &mut FnMut(P<ast::Item>)) { - (*self)(ecx, sp, meta_item, item, push) - } -} - -#[unstable(feature = "rustc_private")] -#[deprecated(since = "1.0.0", reason = "replaced by MultiItemModifier")] -pub trait ItemModifier { - fn expand(&self, - ecx: &mut ExtCtxt, - span: Span, - meta_item: &ast::MetaItem, - item: P<ast::Item>) - -> P<ast::Item>; -} - -#[allow(deprecated)] -#[unstable(feature = "rustc_private")] -#[deprecated(since = "1.0.0", reason = "replaced by MultiItemModifier")] -impl<F> ItemModifier for F - where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, P<ast::Item>) -> P<ast::Item> -{ - - fn expand(&self, - ecx: &mut ExtCtxt, - span: Span, - meta_item: &ast::MetaItem, - item: P<ast::Item>) - -> P<ast::Item> { - (*self)(ecx, span, meta_item, item) - } -} #[derive(Debug,Clone)] pub enum Annotatable { @@ -462,25 +408,11 @@ impl MacResult for DummyResult { pub enum SyntaxExtension { /// A syntax extension that is attached to an item and creates new items /// based upon it. - #[unstable(feature = "rustc_private")] - #[deprecated(since = "1.0.0", reason = "replaced by MultiDecorator")] - #[allow(deprecated)] - Decorator(Box<ItemDecorator + 'static>), - - /// A syntax extension that is attached to an item and creates new items - /// based upon it. /// /// `#[derive(...)]` is a `MultiItemDecorator`. MultiDecorator(Box<MultiItemDecorator + 'static>), /// A syntax extension that is attached to an item and modifies it - /// in-place. - #[unstable(feature = "rustc_private")] - #[deprecated(since = "1.0.0", reason = "replaced by MultiModifier")] - #[allow(deprecated)] - Modifier(Box<ItemModifier + 'static>), - - /// A syntax extension that is attached to an item and modifies it /// in-place. More flexible version than Modifier. MultiModifier(Box<MultiItemModifier + 'static>), |
