about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-02 09:23:47 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-02 09:23:47 -0800
commit6f567e0c29b7987517a4281927fe5265bc6feb30 (patch)
treed46d16fd858b61efcfab170e346235e7f5fa8f22 /src/libsyntax/parse
parent735c308aedbdf73d98bfaceacd5f38152d8eee1b (diff)
parent4ae7c38e7b3edce3343dee520fe588130f140dc8 (diff)
downloadrust-6f567e0c29b7987517a4281927fe5265bc6feb30.tar.gz
rust-6f567e0c29b7987517a4281927fe5265bc6feb30.zip
rollup merge of #20425: sanxiyn/opt-local-ty
This avoids having ast::Ty nodes which have no counterpart in the source.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 832b112921e..9665e61a8cf 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3628,13 +3628,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 {