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]: the trait bound `C: Bar<5>` is not satisfied
LL | pub struct Structure<C: Tec> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar<5>` is not implemented for `C`
|
help: consider further restricting this bound with trait `Bar<5>`
help: consider further restricting this bound with trait `Bar`
|
LL | pub struct Structure<C: Tec + Bar<5>> {
| ++++++++
@ -15,7 +15,7 @@ error[E0277]: the trait bound `C: Bar<5>` is not satisfied
LL | _field: C::BarType,
| ^^^^^^^^^^ the trait `Bar<5>` is not implemented for `C`
|
help: consider further restricting this bound with trait `Bar<5>`
help: consider further restricting this bound with trait `Bar`
|
LL | pub struct Structure<C: Tec + Bar<5>> {
| ++++++++