]> git.lizzy.rs Git - rust.git/commit
Auto merge of #61361 - estebank:infer-type, r=varkor
authorbors <bors@rust-lang.org>
Mon, 3 Jun 2019 02:45:35 +0000 (02:45 +0000)
committerbors <bors@rust-lang.org>
Mon, 3 Jun 2019 02:45:35 +0000 (02:45 +0000)
commitd59dcb261ecdc47d8afaac532050dadf86f3c898
tree49c24f0e4cdfb7b6edd7e2e6300e0679b952c28f
parent3a6bef0cbd01227bbcf593e8504164120a984fdc
parente420f4410ba44b3e39f54c755f456f4f65406e25
Auto merge of #61361 - estebank:infer-type, r=varkor

Add more detail to type inference error

When encountering code where type inference fails, add more actionable
information:

```
fn main() {
    let foo = Vec::new();
}
```

```
error[E0282]: type annotations needed in `std::vec::Vec<T>`
  --> $DIR/vector-no-ann.rs:2:16
   |
LL |     let foo = Vec::new();
   |         ---   ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>`
   |         |
   |         consider giving `foo` a type
```

Fix #25633.
src/librustc/ty/print/pretty.rs