Skip to content

Commit

Permalink
Rollup merge of rust-lang#45060 - topecongiro:semi-in-local-span, r=p…
Browse files Browse the repository at this point in the history
…etrochenkov

Add a semicolon to span for ast::Local
  • Loading branch information
kennytm committed Oct 8, 2017
2 parents ae54d5e + 14c6c11 commit 48cb6af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3671,12 +3671,17 @@ impl<'a> Parser<'a> {
None
};
let init = self.parse_initializer()?;
let hi = if self.token == token::Semi {
self.span
} else {
self.prev_span
};
Ok(P(ast::Local {
ty,
pat,
init,
id: ast::DUMMY_NODE_ID,
span: lo.to(self.prev_span),
span: lo.to(hi),
attrs,
}))
}
Expand Down

0 comments on commit 48cb6af

Please sign in to comment.