From eb69eb36f8c94d97546f2937e134e93d2f0dcb55 Mon Sep 17 00:00:00 2001 From: Marvin Löbel Date: Tue, 11 Mar 2014 00:17:46 +0100 Subject: Added support for type placeholders (explicit requested type inference in a type with `_` ). This enables partial type inference. --- src/libsyntax/parse/parser.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a4877491990..b4f7238c9c7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1274,6 +1274,9 @@ impl Parser { bounds } = self.parse_path(LifetimeAndTypesAndBounds); TyPath(path, bounds, ast::DUMMY_NODE_ID) + } else if self.eat(&token::UNDERSCORE) { + // TYPE TO BE INFERRED + TyInfer } else { let msg = format!("expected type, found token {:?}", self.token); self.fatal(msg); -- cgit 1.4.1-3-g733a5