diff options
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8213d604b91..a7977d5235d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6128,9 +6128,11 @@ impl<'a> Parser<'a> { } else { (None, crate_name) }; - self.expect(&token::Semi)?; + // We grab this before expecting the `;` so it's not a part of the span let prev_span = self.prev_span; + self.expect(&token::Semi)?; + Ok(self.mk_item(lo.to(prev_span), ident, ItemKind::ExternCrate(maybe_path), |
