]> git.lizzy.rs Git - rust.git/commitdiff
Add `isize` and `usize` constructors to Literal
authorAlex Crichton <alex@alexcrichton.com>
Thu, 6 Jul 2017 22:20:01 +0000 (15:20 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 6 Jul 2017 22:20:01 +0000 (15:20 -0700)
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)

src/libproc_macro/lib.rs

index 06f9634d70613e2a47fe4b7d5a246087aff9a865..357e2ab853cbb5d5d0e92db27bd29914680bb20c 100644 (file)
@@ -303,7 +303,7 @@ pub fn integer(n: i128) -> Literal {
         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 {
         Literal(token::Literal(token::Lit::Integer(Symbol::intern(&n.to_string())),
                                Some(Symbol::intern(kind))))