diff options
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index badfbe7eb15..6ea2eed293e 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2305,6 +2305,12 @@ impl<'a> State<'a> { } match lit.node { ast::LitStr(ref st, style) => self.print_string(st.get(), style), + ast::LitByte(byte) => { + let mut res = String::from_str("b'"); + (byte as char).escape_default(|c| res.push_char(c)); + res.push_char('\''); + word(&mut self.s, res.as_slice()) + } ast::LitChar(ch) => { let mut res = String::from_str("'"); ch.escape_default(|c| res.push_char(c)); |
