Merge pull request #4551 from SimonSapin/char-repr
repr: represent char values as char literals rather than integers.
This commit is contained in:
commit
a438bdc8a6
1 changed files with 7 additions and 1 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue