Added support for type placeholders (explicit requested type
inference in a type with `_` ). This enables partial type inference.
This commit is contained in:
parent
6c895d1d58
commit
eb69eb36f8
10 changed files with 236 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue