mozilla/rust — pull request #12764 by Kimundi (2014-03-08 15:21:56+00:00)
Title: Added support for partial type hints (`Foo<_>`).

This patch introduces the `_` token into the type grammar, with the meaning "infer this type".
With this change, the following two lines become equivalent:
```
let x = foo();
let x: _ = foo();
```
But due to its composability, it enables partial type hints like this:
```
let x: Bar<_> = baz();
```

Using it on the item level is explicitly forbidden, as the Rust language does not enable global type inference by design.

This implements the feature requested in https://github.com/mozilla/rust/issues/9508.

---
Remaining issues:
- This probably needs more tests, or rather feedback for which tests are still missing.
- The manual and tutorial still needs updating.
- The change to enable it is very small, there might be code paths not considered yet.
- This is a language change, and needs discussion at a meeting.