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:
parent
568b0ac624
commit
3f2a63a68b
99 changed files with 229 additions and 191 deletions
|
@ -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;
|
||||
| +++++++++++++++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue