about summary refs log tree commit diff
path: root/tests/ui/regions
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-28 20:22:46 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-07 21:29:58 +0000
commit3f2a63a68bbf4e84f7e409659bb64bdd75db39e5 (patch)
tree166009f66e64ed030618966ab5acbad10f2d64c4 /tests/ui/regions
parent568b0ac624553150330f1cc3bbff9b99e5d358a2 (diff)
downloadrust-3f2a63a68bbf4e84f7e409659bb64bdd75db39e5.tar.gz
rust-3f2a63a68bbf4e84f7e409659bb64bdd75db39e5.zip
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 {
   |                  +++++++++++++++++++
```
Diffstat (limited to 'tests/ui/regions')
-rw-r--r--tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
index 37e0ef04085..87f0f47f240 100644
--- a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
+++ b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
 LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
    |
-help: consider restricting type parameter `T` with trait `for<'z> Trait2<'y, 'z>`
+help: consider restricting type parameter `T` with trait `Trait2`
    |
 LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
    |                    ++++++++++++++++++++++++
@@ -17,7 +17,7 @@ LL | |
 LL | | }
    | |_^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
    |
-help: consider restricting type parameter `T` with trait `for<'z> Trait2<'y, 'z>`
+help: consider restricting type parameter `T` with trait `Trait2`
    |
 LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
    |                    ++++++++++++++++++++++++