about summary refs log tree commit diff
path: root/src/libproc_macro
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-04-12 19:50:53 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2018-04-12 20:12:42 +1000
commit4d34bfd00a57f8a8bdb60ec3f908c5d4256f8a9a (patch)
treed4699fcf5af416a32e953be9b85124bb9aab7c9e /src/libproc_macro
parentd26f9e42df76603fd21b0fe5dd1e8001caf9bf81 (diff)
downloadrust-4d34bfd00a57f8a8bdb60ec3f908c5d4256f8a9a.tar.gz
rust-4d34bfd00a57f8a8bdb60ec3f908c5d4256f8a9a.zip
Change the hashcounts in raw `Lit` variants from usize to u16.
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit
platforms.
Diffstat (limited to 'src/libproc_macro')
-rw-r--r--src/libproc_macro/quote.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libproc_macro/quote.rs b/src/libproc_macro/quote.rs
index a0ec6928094..d1f8e75192a 100644
--- a/src/libproc_macro/quote.rs
+++ b/src/libproc_macro/quote.rs
@@ -163,9 +163,9 @@ impl<'a> Quote for &'a str {
     }
 }
 
-impl Quote for usize {
+impl Quote for u16 {
     fn quote(self) -> TokenStream {
-        TokenTree::from(Literal::usize_unsuffixed(self)).into()
+        TokenTree::from(Literal::u16_unsuffixed(self)).into()
     }
 }
 
@@ -197,7 +197,7 @@ macro_rules! literals {
     ($($i:ident),*; $($raw:ident),*) => {
         pub enum LiteralKind {
             $($i,)*
-            $($raw(usize),)*
+            $($raw(u16),)*
         }
 
         impl LiteralKind {