diff options
| author | bors <bors@rust-lang.org> | 2018-04-18 14:44:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-18 14:44:54 +0000 |
| commit | 3dfda165259bf6beefab31bf8708bdf3ec505fe0 (patch) | |
| tree | fc39639749811c041d34696e7117d83dfc7642ed /src/libsyntax/print | |
| parent | 65d201f7d682ad921ac6e67ac07f922aa63a8ce4 (diff) | |
| parent | 4d34bfd00a57f8a8bdb60ec3f908c5d4256f8a9a (diff) | |
| download | rust-3dfda165259bf6beefab31bf8708bdf3ec505fe0.tar.gz rust-3dfda165259bf6beefab31bf8708bdf3ec505fe0.zip | |
Auto merge of #49993 - nnethercote:shrink-Token, r=alexcrichton
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/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 3741850b8a9..bd06ae8c1a9 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -234,11 +234,11 @@ pub fn token_to_string(tok: &Token) -> String { token::Integer(c) => c.to_string(), token::Str_(s) => format!("\"{}\"", s), token::StrRaw(s, n) => format!("r{delim}\"{string}\"{delim}", - delim=repeat("#", n), + delim=repeat("#", n as usize), string=s), token::ByteStr(v) => format!("b\"{}\"", v), token::ByteStrRaw(s, n) => format!("br{delim}\"{string}\"{delim}", - delim=repeat("#", n), + delim=repeat("#", n as usize), string=s), }; @@ -660,7 +660,7 @@ pub trait PrintState<'a> { } ast::StrStyle::Raw(n) => { (format!("r{delim}\"{string}\"{delim}", - delim=repeat("#", n), + delim=repeat("#", n as usize), string=st)) } }; |
