1
Fork 0

Use trait name instead of full constraint in suggestion message

```
help: consider restricting type parameter `T` with traits `Copy` and `Trait`
   |
LL | fn duplicate_custom<T: Copy + Trait>(t: S<T>) -> (S<T>, S<T>) {
   |                      ++++++++++++++
```

```
help: consider restricting type parameter `V` with trait `Copy`
   |
LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V {
   |                  +++++++++++++++++++
```
This commit is contained in:
Esteban Küber 2024-11-28 20:22:46 +00:00
parent 568b0ac624
commit 3f2a63a68b
99 changed files with 229 additions and 191 deletions

View file

@ -4,7 +4,7 @@ error[E0277]: cannot multiply `T` by `T`
LL | type Alias<T> = <T as std::ops::Mul>::Output;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T * T`
|
help: consider restricting type parameter `T` with trait `std::ops::Mul`
help: consider restricting type parameter `T` with trait `Mul`
|
LL | type Alias<T: std::ops::Mul> = <T as std::ops::Mul>::Output;
| +++++++++++++++