Skip to content

Commit df9608b

Browse files
committed
Fix fallout in macro_crate/quote tests.
1 parent f03cddd commit df9608b

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/test/auxiliary/macro_crate_test.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ use syntax::codemap::Span;
2020
use syntax::ext::base::*;
2121
use syntax::parse::token;
2222
use syntax::parse;
23+
use syntax::ptr::P;
2324
use rustc::plugin::Registry;
2425

25-
use std::gc::{Gc, GC};
26-
2726
#[macro_export]
2827
macro_rules! exported_macro (() => (2i))
2928

@@ -57,12 +56,12 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree])
5756
MacExpr::new(quote_expr!(&mut *cx, $expr))
5857
}
5958

60-
fn expand_into_foo(cx: &mut ExtCtxt, sp: Span, attr: Gc<MetaItem>, it: Gc<Item>)
61-
-> Gc<Item> {
62-
box(GC) Item {
59+
fn expand_into_foo(cx: &mut ExtCtxt, sp: Span, attr: &MetaItem, it: P<Item>)
60+
-> P<Item> {
61+
P(Item {
6362
attrs: it.attrs.clone(),
6463
..(*quote_item!(cx, enum Foo { Bar, Baz }).unwrap()).clone()
65-
}
64+
})
6665
}
6766

6867
fn expand_forged_ident(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacResult+'static> {

src/test/run-pass-fulldeps/quote-tokens.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@
1616
extern crate syntax;
1717

1818
use syntax::ext::base::ExtCtxt;
19-
use std::gc::Gc;
19+
use syntax::ptr::P;
2020

2121
fn syntax_extension(cx: &ExtCtxt) {
2222
let e_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, 1 + 2);
2323
let p_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *));
2424

25-
let a: Gc<syntax::ast::Expr> = quote_expr!(cx, 1 + 2);
26-
let _b: Option<Gc<syntax::ast::Item>> = quote_item!(cx, static foo : int = $e_toks; );
27-
let _c: Gc<syntax::ast::Pat> = quote_pat!(cx, (x, 1 .. 4, *) );
28-
let _d: Gc<syntax::ast::Stmt> = quote_stmt!(cx, let x = $a; );
25+
let a: P<syntax::ast::Expr> = quote_expr!(cx, 1 + 2);
26+
let _b: Option<P<syntax::ast::Item>> = quote_item!(cx, static foo : int = $e_toks; );
27+
let _c: P<syntax::ast::Pat> = quote_pat!(cx, (x, 1 .. 4, *) );
28+
let _d: P<syntax::ast::Stmt> = quote_stmt!(cx, let x = $a; );
2929
let _d: syntax::ast::Arm = quote_arm!(cx, (ref x, ref y) = (x, y) );
30-
let _e: Gc<syntax::ast::Expr> = quote_expr!(cx, match foo { $p_toks => 10 } );
30+
let _e: P<syntax::ast::Expr> = quote_expr!(cx, match foo { $p_toks => 10 } );
3131

32-
let _f: Gc<syntax::ast::Expr> = quote_expr!(cx, ());
33-
let _g: Gc<syntax::ast::Expr> = quote_expr!(cx, true);
34-
let _h: Gc<syntax::ast::Expr> = quote_expr!(cx, 'a');
32+
let _f: P<syntax::ast::Expr> = quote_expr!(cx, ());
33+
let _g: P<syntax::ast::Expr> = quote_expr!(cx, true);
34+
let _h: P<syntax::ast::Expr> = quote_expr!(cx, 'a');
3535

36-
let i: Option<Gc<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; );
36+
let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; );
3737
assert!(i.is_some());
3838
}
3939

0 commit comments

Comments
 (0)