diff options
| author | bors <bors@rust-lang.org> | 2019-04-29 01:22:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-04-29 01:22:12 +0000 |
| commit | c7fcbfbf1fff2794de5ec6dcb0a052c345ded3a7 (patch) | |
| tree | 47641adf8b6e9f5ab948e7d589bb0d12fc57e802 /src/libsyntax/parse/lexer/mod.rs | |
| parent | 272000c94edda10d3ccd7042d2b9914c2c974f29 (diff) | |
| parent | b83ea7f91799fd2178de1cc4e897c5b605697965 (diff) | |
| download | rust-c7fcbfbf1fff2794de5ec6dcb0a052c345ded3a7.tar.gz rust-c7fcbfbf1fff2794de5ec6dcb0a052c345ded3a7.zip | |
Auto merge of #60182 - matklad:lexer-cleanup, r=petrochenkov
Lexer cleanup another couple of tiny cleanups
Diffstat (limited to 'src/libsyntax/parse/lexer/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index aad2acfd6d4..cf8f8abe2ab 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) @@ -1420,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() { |
