From c29a98e40d825c7f0f6a1d9013747266e835d0be Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Apr 2019 00:03:57 +0300 Subject: remove obsolete and incorrect comment --- src/libsyntax/parse/lexer/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libsyntax/parse/lexer') diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index aad2acfd6d4..61322985b9a 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -446,9 +446,7 @@ impl<'a> StringReader<'a> { self.with_str_from_to(start, self.pos, f) } - /// Creates a Name from a given offset to the current offset, each - /// adjusted 1 towards each other (assumes that on either side there is a - /// single-byte delimiter). + /// Creates a Name from a given offset to the current offset. fn name_from(&self, start: BytePos) -> ast::Name { debug!("taking an ident from {:?} to {:?}", start, self.pos); self.with_str_from(start, Symbol::intern) -- cgit 1.4.1-3-g733a5 From 28ce23fe8bfee55a0810b4347423e66c7621650a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Apr 2019 00:05:06 +0300 Subject: simplify and avoid allocation --- src/libsyntax/parse/lexer/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse/lexer') diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 61322985b9a..cf8f8abe2ab 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1418,8 +1418,8 @@ impl<'a> StringReader<'a> { // Include the leading `'` in the real identifier, for macro // expansion purposes. See #12512 for the gory details of why // this is necessary. - let ident = self.with_str_from(start, |lifetime_name| { - self.mk_ident(&format!("'{}", lifetime_name)) + let ident = self.with_str_from(start_with_quote, |lifetime_name| { + self.mk_ident(lifetime_name) }); if c2.is_numeric() { -- cgit 1.4.1-3-g733a5