From e02ffb2c2d639eb813d9924ca1c3e9c6b7d0e534 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 12 Nov 2010 16:11:33 -0800 Subject: rustc: Add a type annotation for locals --- src/comp/front/ast.rs | 3 ++- src/comp/front/parser.rs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/comp') diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index f70c6ac3..c3b38cb6 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -80,7 +80,8 @@ type local = rec(option.t[@ty] ty, bool infer, ident ident, option.t[@expr] init, - def_id id); + def_id id, + ann ann); type decl = spanned[decl_]; tag decl_ { diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 19c72a34..2382efc1 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -731,7 +731,8 @@ impure fn parse_let(parser p) -> @ast.decl { infer = false, ident = ident, init = init, - id = p.next_def_id()); + id = p.next_def_id(), + ann = ast.ann_none); ret @spanned(lo, hi, ast.decl_local(@local)); } @@ -750,7 +751,8 @@ impure fn parse_auto(parser p) -> @ast.decl { infer = true, ident = ident, init = init, - id = p.next_def_id()); + id = p.next_def_id(), + ann = ast.ann_none); ret @spanned(lo, hi, ast.decl_local(@local)); } -- cgit v1.2.3