Skip to content

Commit

Permalink
Fix for upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Aug 6, 2014
1 parent fa5d803 commit f5a3223
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions phf_mac/src/lib.rs
Expand Up @@ -253,14 +253,18 @@ fn parse_key(cx: &mut ExtCtxt, e: &Expr) -> Option<Key> {
ast::LitBinary(ref b) => Some(KeyBinary(b.clone())),
ast::LitByte(b) => Some(KeyU8(b)),
ast::LitChar(c) => Some(KeyChar(c)),
ast::LitInt(i, ast::TyI8) => Some(KeyI8(i as i8)),
ast::LitInt(i, ast::TyI16) => Some(KeyI16(i as i16)),
ast::LitInt(i, ast::TyI32) => Some(KeyI32(i as i32)),
ast::LitInt(i, ast::TyI64) => Some(KeyI64(i as i64)),
ast::LitUint(i, ast::TyU8) => Some(KeyU8(i as u8)),
ast::LitUint(i, ast::TyU16) => Some(KeyU16(i as u16)),
ast::LitUint(i, ast::TyU32) => Some(KeyU32(i as u32)),
ast::LitUint(i, ast::TyU64) => Some(KeyU64(i as u64)),
ast::LitInt(i, ast::SignedIntLit(ast::TyI8, ast::Plus)) => Some(KeyI8(i as i8)),
ast::LitInt(i, ast::SignedIntLit(ast::TyI8, ast::Minus)) => Some(KeyI8(-(i as i8))),
ast::LitInt(i, ast::SignedIntLit(ast::TyI16, ast::Plus)) => Some(KeyI16(i as i16)),
ast::LitInt(i, ast::SignedIntLit(ast::TyI16, ast::Minus)) => Some(KeyI16(-(i as i16))),
ast::LitInt(i, ast::SignedIntLit(ast::TyI32, ast::Plus)) => Some(KeyI32(i as i32)),
ast::LitInt(i, ast::SignedIntLit(ast::TyI32, ast::Minus)) => Some(KeyI32(-(i as i32))),
ast::LitInt(i, ast::SignedIntLit(ast::TyI64, ast::Plus)) => Some(KeyI64(i as i64)),
ast::LitInt(i, ast::SignedIntLit(ast::TyI64, ast::Minus)) => Some(KeyI64(-(i as i64))),
ast::LitInt(i, ast::UnsignedIntLit(ast::TyU8)) => Some(KeyU8(i as u8)),
ast::LitInt(i, ast::UnsignedIntLit(ast::TyU16)) => Some(KeyU16(i as u16)),
ast::LitInt(i, ast::UnsignedIntLit(ast::TyU32)) => Some(KeyU32(i as u32)),
ast::LitInt(i, ast::UnsignedIntLit(ast::TyU64)) => Some(KeyU64(i as u64)),
ast::LitBool(b) => Some(KeyBool(b)),
_ => {
cx.span_err(e.span, "unsupported literal type");
Expand Down

0 comments on commit f5a3223

Please sign in to comment.