]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #95991 - PoorlyDefinedBehaviour:fix/issue_95898, r=fee1-dead
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Wed, 13 Apr 2022 15:35:34 +0000 (17:35 +0200)
committerGitHub <noreply@github.com>
Wed, 13 Apr 2022 15:35:34 +0000 (17:35 +0200)
commit648d65ac7b9c8309620dc86ee60cebafe2a811e2
treea746c3bc511f7f9f3e0f1149525094319dc3c0d4
parent032358bd30d2eaa31cdec4a40d8a4703fbec22cc
parent9b9f6771049ecd30f13138c32f23ba6562a613d5
Rollup merge of #95991 - PoorlyDefinedBehaviour:fix/issue_95898, r=fee1-dead

fix: wrong trait import suggestion for T:

The suggestion to bound `T` had an extra `:`.

```rust
fn foo<T:>(t: T) {
  t.clone();
}
```

```
error[E0599]: no method named `clone` found for type parameter `T` in the current scope
 --> src/lib.rs:2:7
  |
2 |     t.clone();
  |       ^^^^^ method not found in `T`
  |
  = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `clone`, perhaps you need to restrict type parameter `T` with it:
  |
1 | fn foo<T: Clone:>(t: T) {
  |        ~~~~~~~~
 ```

Fixes: #95898