Skip to content

Commit

Permalink
Fix phf_macros
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Mar 2, 2015
1 parent 8078e83 commit 6567152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phf_macros/src/lib.rs
Expand Up @@ -31,7 +31,7 @@
//! # fn main() {}
//! ```
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]
#![feature(plugin_registrar, quote, rustc_private, env, std_misc)]
#![feature(plugin_registrar, quote, rustc_private, std_misc)]

extern crate syntax;
#[cfg(feature = "stats")]
Expand Down
10 changes: 5 additions & 5 deletions phf_macros/src/util.rs
Expand Up @@ -3,7 +3,7 @@ use std::hash::{Hash, Hasher};

use syntax::ast::Expr;
use syntax::codemap::Span;
use syntax::ext::base::{ExtCtxt, MacResult, MacExpr};
use syntax::ext::base::{ExtCtxt, MacResult, MacEager};
use syntax::ext::build::AstBuilder;
use syntax::parse::token::InternedString;
use syntax::ptr::P;
Expand Down Expand Up @@ -91,7 +91,7 @@ pub fn create_map(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state: HashSt
let entries = cx.expr_vec(sp, entries);

let key = state.key;
MacExpr::new(quote_expr!(cx, ::phf::Map {
MacEager::expr(quote_expr!(cx, ::phf::Map {
key: $key,
disps: &$disps,
entries: &$entries,
Expand All @@ -101,7 +101,7 @@ pub fn create_map(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state: HashSt
pub fn create_set(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state: HashState)
-> Box<MacResult+'static> {
let map = create_map(cx, sp, entries, state).make_expr().unwrap();
MacExpr::new(quote_expr!(cx, ::phf::Set { map: $map }))
MacEager::expr(quote_expr!(cx, ::phf::Set { map: $map }))
}

pub fn create_ordered_map(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state: HashState)
Expand All @@ -120,7 +120,7 @@ pub fn create_ordered_map(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state
let entries = cx.expr_vec(sp, entries);

let key = state.key;
MacExpr::new(quote_expr!(cx, ::phf::OrderedMap {
MacEager::expr(quote_expr!(cx, ::phf::OrderedMap {
key: $key,
disps: &$disps,
idxs: &$idxs,
Expand All @@ -131,5 +131,5 @@ pub fn create_ordered_map(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state
pub fn create_ordered_set(cx: &mut ExtCtxt, sp: Span, entries: Vec<Entry>, state: HashState)
-> Box<MacResult+'static> {
let map = create_ordered_map(cx, sp, entries, state).make_expr().unwrap();
MacExpr::new(quote_expr!(cx, ::phf::OrderedSet { map: $map }))
MacEager::expr(quote_expr!(cx, ::phf::OrderedSet { map: $map }))
}

0 comments on commit 6567152

Please sign in to comment.