repr: represent char values as char literals rather than integers.

This commit is contained in:
Simon Sapin 2013-01-20 12:01:18 +01:00
parent 5d07a70fb3
commit 9788c41ce7

View File

@ -286,7 +286,13 @@ impl ReprVisitor : TyVisitor {
fn visit_f32() -> bool { self.write::<f32>() }
fn visit_f64() -> bool { self.write::<f64>() }
fn visit_char() -> bool { self.write::<u32>() }
fn visit_char() -> bool {
do self.get::<char> |&ch| {
self.writer.write_char('\'');
self.writer.write_escaped_char(ch);
self.writer.write_char('\'');
}
}
// Type no longer exists, vestigial function.
fn visit_str() -> bool { fail; }