about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-19 10:30:01 +0100
committerGitHub <noreply@github.com>2019-12-19 10:30:01 +0100
commit06985c68592112ef256eb08140f38a30b602d35c (patch)
tree9fb998a8d7f0d19bc4ad5a7e37ee1fa694e27de6 /src/test/codegen/src-hash-algorithm
parentcfa7581028c182b541917b4ee13af8f639842971 (diff)
parenta4a2fc0af33ef5a4e1211c5d3e4f0eeca02322f8 (diff)
downloadrust-06985c68592112ef256eb08140f38a30b602d35c.tar.gz
rust-06985c68592112ef256eb08140f38a30b602d35c.zip
Rollup merge of #67406 - ohadravid:suggest-assoc-type, r=estebank
Suggest associated type when the specified one cannot be found

Fixes #67386, so code like this:
```
use std::ops::Deref;

fn homura<T: Deref<Trget = i32>>(_: T) {}

fn main() {}
```

results in:
```
error[E0220]: associated type `Trget` not found for `std::ops::Deref`
 --> type-binding.rs:6:20
  |
6 | fn homura<T: Deref<Trget = i32>>(_: T) {}
  |                    ^^^^^^^^^^^ help: there is an associated type with a similar name: `Target`

error: aborting due to previous error
```

(The `help` is new)

I used an `all_candidates: impl Fn() -> Iterator<...>` instead of `collect`ing to avoid the cost of allocating the Vec when no errors are found, at the expense of a little added complexity.

r? @estebank
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions