about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-11-12 14:38:44 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2018-11-12 15:16:03 +1100
commitc6862992d947331cd6556f765f6efbde0a709cf9 (patch)
treea7a97a17e206359789ba630882235c1c4d2764a5 /src/libsyntax/parse/parser.rs
parent5a2ca1a6f18aa93d3120761f614ec2d39b4cb1ac (diff)
downloadrust-c6862992d947331cd6556f765f6efbde0a709cf9.tar.gz
rust-c6862992d947331cd6556f765f6efbde0a709cf9.zip
Change `Lit::short_name` to `Lit::literal_name`.
This avoids a moderately hot allocation in `parse_lit_token`.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs2
1 files changed, 1 insertions, 1 deletions
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()