]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #66042 - ohadravid:suggest-correct-code-when-ref-current-trait, r...
authorPietro Albini <pietro@pietroalbini.org>
Tue, 5 Nov 2019 08:49:58 +0000 (09:49 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Nov 2019 08:49:58 +0000 (09:49 +0100)
Suggest correct code when encountering an incorrect trait bound referencing the current trait

Fixes #65985 and also improves the suggestion for code like this:

```
trait Grab {
    type Value;
    fn grab(&self) -> Grab::Value;
}
```

To suggest `<Self as Grab>::Value`.

I wasn't sure which of the syntax versions is better (`<Self as ..>::` vs `Self::`), so I used the former simply because it was less change to the existing code.

r? @estebank


Trivial merge