diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2014-03-11 00:17:46 +0100 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2014-03-14 14:57:31 +0100 |
| commit | eb69eb36f8c94d97546f2937e134e93d2f0dcb55 (patch) | |
| tree | 20da050fec8ddaa7020aaf90bd70e0de7dcdadaa /src/libsyntax/parse | |
| parent | 6c895d1d588e6cb7ae3f308f709272a11e8278da (diff) | |
| download | rust-eb69eb36f8c94d97546f2937e134e93d2f0dcb55.tar.gz rust-eb69eb36f8c94d97546f2937e134e93d2f0dcb55.zip | |
Added support for type placeholders (explicit requested type
inference in a type with `_` ). This enables partial type inference.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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); |
