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
This commit is contained in:
Nick Cameron
2015-07-06 14:13:19 +12:00
parent bf34187a2f
commit f47d20aecd
5 changed files with 29 additions and 13 deletions

View File

@@ -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();