diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-07-06 14:13:19 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-07-21 21:55:19 +1200 |
| commit | f47d20aecdcd7db34d41ad1666fd3eee095cc943 (patch) | |
| tree | 7bad65f9a57209784410c8af9e2b42a5009eaea3 /src/libsyntax/parse/lexer | |
| parent | bf34187a2f874690798b06d9350c1f6c4755243a (diff) | |
| download | rust-f47d20aecdcd7db34d41ad1666fd3eee095cc943.tar.gz rust-f47d20aecdcd7db34d41ad1666fd3eee095cc943.zip | |
Use a span from the correct file for the inner span of a module
This basically only affects modules which are empty (or only contain comments). Closes #26755
Diffstat (limited to 'src/libsyntax/parse/lexer')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index b6a3788dacc..621335ecd97 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -231,6 +231,7 @@ impl<'a> StringReader<'a> { None => { if self.is_eof() { self.peek_tok = token::Eof; + self.peek_span = codemap::mk_sp(self.filemap.end_pos, self.filemap.end_pos); } else { let start_bytepos = self.last_pos; self.peek_tok = self.next_token_inner(); |
