Added support for type placeholders (explicit requested type

inference in a type with `_` ). This enables partial type inference.
This commit is contained in:
Marvin Löbel 2014-03-11 00:17:46 +01:00
parent 6c895d1d58
commit eb69eb36f8
10 changed files with 236 additions and 11 deletions

View file

@ -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);