Skip to content

Commit e02ffb2

Browse files
committed
rustc: Add a type annotation for locals
1 parent 0578978 commit e02ffb2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/comp/front/ast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ type local = rec(option.t[@ty] ty,
8080
bool infer,
8181
ident ident,
8282
option.t[@expr] init,
83-
def_id id);
83+
def_id id,
84+
ann ann);
8485

8586
type decl = spanned[decl_];
8687
tag decl_ {

src/comp/front/parser.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ impure fn parse_let(parser p) -> @ast.decl {
731731
infer = false,
732732
ident = ident,
733733
init = init,
734-
id = p.next_def_id());
734+
id = p.next_def_id(),
735+
ann = ast.ann_none);
735736

736737
ret @spanned(lo, hi, ast.decl_local(@local));
737738
}
@@ -750,7 +751,8 @@ impure fn parse_auto(parser p) -> @ast.decl {
750751
infer = true,
751752
ident = ident,
752753
init = init,
753-
id = p.next_def_id());
754+
id = p.next_def_id(),
755+
ann = ast.ann_none);
754756

755757
ret @spanned(lo, hi, ast.decl_local(@local));
756758
}

0 commit comments

Comments
 (0)