From c6862992d947331cd6556f765f6efbde0a709cf9 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 12 Nov 2018 14:38:44 +1100 Subject: Change `Lit::short_name` to `Lit::literal_name`. This avoids a moderately hot allocation in `parse_lit_token`. --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 68e7e40c43e..d90ec4ea081 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1956,7 +1956,7 @@ impl<'a> Parser<'a> { if suffix_illegal { let sp = self.span; - self.expect_no_suffix(sp, &format!("{} literal", lit.short_name()), suf) + self.expect_no_suffix(sp, lit.literal_name(), suf) } result.unwrap() -- cgit 1.4.1-3-g733a5