1
Fork 0

Make type in ast::Local optional

This commit is contained in:
Seo Sanghyeon 2015-01-02 20:55:31 +09:00
parent ee3c5957ea
commit f2a06f760b
11 changed files with 31 additions and 28 deletions

View file

@ -3627,13 +3627,9 @@ impl<'a> Parser<'a> {
let lo = self.span.lo;
let pat = self.parse_pat();
let mut ty = P(Ty {
id: ast::DUMMY_NODE_ID,
node: TyInfer,
span: mk_sp(lo, lo),
});
let mut ty = None;
if self.eat(&token::Colon) {
ty = self.parse_ty_sum();
ty = Some(self.parse_ty_sum());
}
let init = self.parse_initializer();
P(ast::Local {