Skip to content

Commit 2094514

Browse files
committed
hexfloat: fix fallout from using ptr::P.
1 parent 9651d94 commit 2094514

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libhexfloat/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ use syntax::ext::base;
5757
use syntax::ext::base::{ExtCtxt, MacExpr};
5858
use syntax::ext::build::AstBuilder;
5959
use syntax::parse::token;
60+
use syntax::ptr::P;
6061
use rustc::plugin::Registry;
6162

62-
use std::gc::Gc;
63-
6463
#[plugin_registrar]
6564
pub fn plugin_registrar(reg: &mut Registry) {
6665
reg.register_macro("hexfloat", expand_syntax_ext);
@@ -122,7 +121,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
122121

123122
let s = match expr.node {
124123
// expression is a literal
125-
ast::ExprLit(lit) => match lit.node {
124+
ast::ExprLit(ref lit) => match lit.node {
126125
// string literal
127126
ast::LitStr(ref s, _) => {
128127
s.clone()
@@ -167,7 +166,7 @@ struct Ident {
167166
}
168167

169168
fn parse_tts(cx: &ExtCtxt,
170-
tts: &[ast::TokenTree]) -> (Gc<ast::Expr>, Option<Ident>) {
169+
tts: &[ast::TokenTree]) -> (P<ast::Expr>, Option<Ident>) {
171170
let p = &mut cx.new_parser_from_tts(tts);
172171
let ex = p.parse_expr();
173172
let id = if p.token == token::EOF {

0 commit comments

Comments
 (0)