Add isize and usize constructors to Literal

This commit fills out the remaining integer literal constructors on the
`proc_macro::Literal` type with `isize` and `usize`. (I think these were just
left out by accident)
This commit is contained in:
Alex Crichton
2017-07-06 15:20:01 -07:00
parent 4d526e0d14
commit 28ce2924f1

View File

@@ -303,7 +303,7 @@ impl Literal {
Literal(token::Literal(token::Lit::Integer(Symbol::intern(&n.to_string())), None)) Literal(token::Literal(token::Lit::Integer(Symbol::intern(&n.to_string())), None))
} }
int_literals!(u8, i8, u16, i16, u32, i32, u64, i64); int_literals!(u8, i8, u16, i16, u32, i32, u64, i64, usize, isize);
fn typed_integer(n: i128, kind: &'static str) -> Literal { fn typed_integer(n: i128, kind: &'static str) -> Literal {
Literal(token::Literal(token::Lit::Integer(Symbol::intern(&n.to_string())), Literal(token::Literal(token::Lit::Integer(Symbol::intern(&n.to_string())),
Some(Symbol::intern(kind)))) Some(Symbol::intern(kind))))