From dfe1f6260e7e076114b95b42053cf6dc4cbaca68 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 3 Aug 2012 11:22:35 -0700 Subject: rustc: Remove all fixed-length strings from our codebase --- src/libsyntax/parse/parser.rs | 2 +- src/libsyntax/parse/token.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f697685796f..02646614435 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2164,7 +2164,7 @@ class parser { } _ => { self.fatal(~"expected `,` or `)`, found `" + - token_to_str(self.reader, self.token) + "`"); + token_to_str(self.reader, self.token) + ~"`"); } } } else { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 9d3bbef2cd4..3dbcef66732 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -167,8 +167,8 @@ fn to_str(in: interner<@~str>, t: token) -> ~str { } LIT_FLOAT(s, t) { let mut body = *in.get(s); - if body.ends_with(".") { - body = body + "0"; // `10.f` is not a float literal + if body.ends_with(~".") { + body = body + ~"0"; // `10.f` is not a float literal } body + ast_util::float_ty_to_str(t) } -- cgit 1.4.1-3-g733a5