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/test | |
| 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/test')
| -rw-r--r-- | src/test/auxiliary/macro_crate_test.rs | 12 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/macro-crate.rs | 7 |
2 files changed, 0 insertions, 19 deletions
diff --git a/src/test/auxiliary/macro_crate_test.rs b/src/test/auxiliary/macro_crate_test.rs index 9474533a9b5..77f0e0f2c34 100644 --- a/src/test/auxiliary/macro_crate_test.rs +++ b/src/test/auxiliary/macro_crate_test.rs @@ -31,10 +31,6 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_macro("make_a_1", expand_make_a_1); reg.register_macro("identity", expand_identity); reg.register_syntax_extension( - token::intern("into_foo"), - // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. - Modifier(Box::new(expand_into_foo))); - reg.register_syntax_extension( token::intern("into_multi_foo"), // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. MultiModifier(Box::new(expand_into_foo_multi))); @@ -62,14 +58,6 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree]) MacEager::expr(quote_expr!(&mut *cx, $expr)) } -fn expand_into_foo(cx: &mut ExtCtxt, sp: Span, attr: &MetaItem, it: P<Item>) - -> P<Item> { - P(Item { - attrs: it.attrs.clone(), - ..(*quote_item!(cx, enum Foo { Bar, Baz }).unwrap()).clone() - }) -} - fn expand_into_foo_multi(cx: &mut ExtCtxt, sp: Span, attr: &MetaItem, diff --git a/src/test/run-pass-fulldeps/macro-crate.rs b/src/test/run-pass-fulldeps/macro-crate.rs index 7a2846c31b6..3a381963669 100644 --- a/src/test/run-pass-fulldeps/macro-crate.rs +++ b/src/test/run-pass-fulldeps/macro-crate.rs @@ -17,10 +17,6 @@ #[macro_use] #[no_link] extern crate macro_crate_test; -#[into_foo] -#[derive(PartialEq, Clone, Debug)] -fn foo() -> AFakeTypeThatHadBetterGoAway {} - #[into_multi_foo] #[derive(PartialEq, Clone, Debug)] fn foo() -> AnotherFakeTypeThatHadBetterGoAway {} @@ -41,9 +37,6 @@ pub fn main() { assert_eq!(1, make_a_1!()); assert_eq!(2, exported_macro!()); - assert_eq!(Foo::Bar, Foo::Bar); - test(None::<Foo>); - assert_eq!(Foo2::Bar2, Foo2::Bar2); test(None::<Foo2>); |
