1
Fork 0

Instead of modifying the item's span synthesize it

This commit is contained in:
Esteban Küber 2018-01-25 22:40:38 -08:00
parent c39ad4b145
commit 445e404ba4
4 changed files with 12 additions and 6 deletions

View file

@ -6128,11 +6128,10 @@ impl<'a> Parser<'a> {
} else {
(None, crate_name)
};
// 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)?;
let prev_span = self.prev_span;
Ok(self.mk_item(lo.to(prev_span),
ident,
ItemKind::ExternCrate(maybe_path),