]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #68689 - estebank:where-clause-sugg-missing-fn, r=varkor
authorbors <bors@rust-lang.org>
Sun, 9 Feb 2020 07:11:56 +0000 (07:11 +0000)
committerbors <bors@rust-lang.org>
Sun, 9 Feb 2020 07:11:56 +0000 (07:11 +0000)
commit64ea639c12df0594dd891b1ba0b439c8c5eacd83
treeb7c8a01a9da6209411c3fe10a4901903e864f1e0
parentf8d830b4decaef5a6ae0f27baac14dfb48baa4c5
parent3cdd7ae59ef9df70f3b31024466266160c9f5d11
Auto merge of #68689 - estebank:where-clause-sugg-missing-fn, r=varkor

When suggesting associated fn with type parameters, include in the structured suggestion

Address #50734.

```
error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `baz`
  --> file.rs:14:1
   |
14 | impl TraitA<()> for S {
   | ^^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `baz` in implementation
   |
   = help: implement the missing item: `fn foo<T>(_: T) -> Self where T: TraitB, TraitB::Item = A { unimplemented!() }`
   = help: implement the missing item: `fn bar<T>(_: T) -> Self { unimplemented!() }`
   = help: implement the missing item: `fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: std::marker::Copy { unimplemented!() }`
```

It doesn't work well for associated types with `ty::Predicate::Projection`s as we need to resugar `T: Trait, Trait::Assoc = K` → `T: Trait<Assoc = K>`.
src/librustc_typeck/check/mod.rs