Added support for type placeholders (explicit requested type
inference in a type with `_` ). This enables partial type inference.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user