Skip to content

Commit daae830

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 152401 b: refs/heads/try2 c: 5084de3 h: refs/heads/master i: 152399: af1faa5 v: v3
1 parent 32a7fdc commit daae830

File tree

7 files changed

+31
-37
lines changed

7 files changed

+31
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: aca0bac29f7d7e86edfb5850cef1ab9b5e4797f2
8+
refs/heads/try2: 5084de3aafa4b8e014a1b8698fdd2e5e62b97fa7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/test/auxiliary/macro_crate_test.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,28 @@
1010

1111
// force-host
1212

13-
#![feature(globs, macro_registrar, macro_rules, quote, managed_boxes)]
13+
#![feature(globs, plugin_registrar, macro_rules, quote, managed_boxes)]
1414

1515
extern crate syntax;
16+
extern crate rustc;
1617

17-
use syntax::ast::{Name, TokenTree, Item, MetaItem};
18+
use syntax::ast::{TokenTree, Item, MetaItem};
1819
use syntax::codemap::Span;
1920
use syntax::ext::base::*;
2021
use syntax::parse::token;
22+
use rustc::plugin::Registry;
2123

2224
#[macro_export]
2325
macro_rules! exported_macro (() => (2))
2426

2527
macro_rules! unexported_macro (() => (3))
2628

27-
#[macro_registrar]
28-
pub fn macro_registrar(register: |Name, SyntaxExtension|) {
29-
register(token::intern("make_a_1"),
30-
NormalTT(box BasicMacroExpander {
31-
expander: expand_make_a_1,
32-
span: None,
33-
},
34-
None));
35-
register(token::intern("into_foo"), ItemModifier(expand_into_foo));
29+
#[plugin_registrar]
30+
pub fn plugin_registrar(reg: &mut Registry) {
31+
reg.register_macro("make_a_1", expand_make_a_1);
32+
reg.register_syntax_extension(
33+
token::intern("into_foo"),
34+
ItemModifier(expand_into_foo));
3635
}
3736

3837
fn expand_make_a_1(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])

branches/try2/src/test/auxiliary/macro_crate_outlive_expansion_phase.rs renamed to branches/try2/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010

1111
// force-host
1212

13-
#![feature(macro_registrar)]
13+
#![feature(plugin_registrar)]
1414

15-
extern crate syntax;
15+
extern crate rustc;
1616

1717
use std::any::Any;
18-
use syntax::ast::Name;
19-
use syntax::ext::base::SyntaxExtension;
18+
use rustc::plugin::Registry;
2019

2120
struct Foo {
2221
foo: int
@@ -26,8 +25,8 @@ impl Drop for Foo {
2625
fn drop(&mut self) {}
2726
}
2827

29-
#[macro_registrar]
30-
pub fn registrar(_: |Name, SyntaxExtension|) {
28+
#[plugin_registrar]
29+
pub fn registrar(_: &mut Registry) {
3130
local_data_key!(foo: Box<Any:Send>);
3231
foo.replace(Some(box Foo { foo: 10 } as Box<Any:Send>));
3332
}

branches/try2/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,20 @@
1212
// no-prefer-dynamic
1313

1414
#![crate_type = "dylib"]
15-
#![feature(macro_registrar, quote, globs)]
15+
#![feature(plugin_registrar, quote, globs)]
1616

1717
extern crate other = "syntax-extension-with-dll-deps-1";
1818
extern crate syntax;
19+
extern crate rustc;
1920

20-
use syntax::ast::{Name, TokenTree, Item, MetaItem};
21+
use syntax::ast::{TokenTree, Item, MetaItem};
2122
use syntax::codemap::Span;
2223
use syntax::ext::base::*;
23-
use syntax::parse::token;
24+
use rustc::plugin::Registry;
2425

25-
#[macro_registrar]
26-
pub fn macro_registrar(register: |Name, SyntaxExtension|) {
27-
register(token::intern("foo"),
28-
NormalTT(box BasicMacroExpander {
29-
expander: expand_foo,
30-
span: None,
31-
},
32-
None));
26+
#[plugin_registrar]
27+
pub fn plugin_registrar(reg: &mut Registry) {
28+
reg.register_macro("foo", expand_foo);
3329
}
3430

3531
fn expand_foo(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])

branches/try2/src/test/compile-fail/gated-macro_registrar.rs renamed to branches/try2/src/test/compile-fail/gated-plugin_registrar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// the registration function isn't typechecked yet
12-
#[macro_registrar]
13-
pub fn registrar() {} //~ ERROR cross-crate macro exports are experimental
12+
#[plugin_registrar]
13+
pub fn registrar() {} //~ ERROR compiler plugins are experimental
1414

1515
fn main() {}

branches/try2/src/test/compile-fail/multiple-macro-registrars.rs renamed to branches/try2/src/test/compile-fail/multiple-plugin-registrars.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: multiple macro registration functions found
11+
// error-pattern: multiple plugin registration functions found
1212

13-
#![feature(macro_registrar)]
13+
#![feature(plugin_registrar)]
1414

1515
// the registration function isn't typechecked yet
16-
#[macro_registrar]
16+
#[plugin_registrar]
1717
pub fn one() {}
1818

19-
#[macro_registrar]
19+
#[plugin_registrar]
2020
pub fn two() {}
2121

2222
fn main() {}

branches/try2/src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// aux-build:macro_crate_outlive_expansion_phase.rs
11+
// aux-build:plugin_crate_outlive_expansion_phase.rs
1212
// ignore-stage1
1313

1414
#![feature(phase)]
1515

1616
#[phase(plugin)]
17-
extern crate macro_crate_outlive_expansion_phase;
17+
extern crate plugin_crate_outlive_expansion_phase;
1818

1919
pub fn main() {}

0 commit comments

Comments
 (0)