diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-11-28 20:22:46 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-07 21:29:58 +0000 |
| commit | 3f2a63a68bbf4e84f7e409659bb64bdd75db39e5 (patch) | |
| tree | 166009f66e64ed030618966ab5acbad10f2d64c4 /tests/ui/impl-trait | |
| parent | 568b0ac624553150330f1cc3bbff9b99e5d358a2 (diff) | |
| download | rust-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/impl-trait')
| -rw-r--r-- | tests/ui/impl-trait/in-trait/false-positive-predicate-entailment-error.current.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/impl-trait/issue-55872-1.stderr | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/impl-trait/in-trait/false-positive-predicate-entailment-error.current.stderr b/tests/ui/impl-trait/in-trait/false-positive-predicate-entailment-error.current.stderr index 47c0d1df8a4..f86601ef119 100644 --- a/tests/ui/impl-trait/in-trait/false-positive-predicate-entailment-error.current.stderr +++ b/tests/ui/impl-trait/in-trait/false-positive-predicate-entailment-error.current.stderr @@ -17,7 +17,7 @@ LL | impl<A, F: MyFn<A>> Callback<A> for F { | ------- ^^^^^^^^^^^ ^ | | | unsatisfied trait bound introduced here -help: consider further restricting this bound with trait `MyFn<i32>` +help: consider further restricting this bound with trait `MyFn` | LL | F: Callback<Self::CallbackArg> + MyFn<i32>, | +++++++++++ @@ -43,7 +43,7 @@ LL | fn autobatch<F>(self) -> impl Trait ... LL | F: Callback<Self::CallbackArg>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<Sender as ChannelSender>::autobatch` -help: consider further restricting this bound with trait `MyFn<i32>` +help: consider further restricting this bound with trait `MyFn` | LL | F: Callback<Self::CallbackArg> + MyFn<i32>, | +++++++++++ @@ -68,7 +68,7 @@ LL | impl<A, F: MyFn<A>> Callback<A> for F { | | | unsatisfied trait bound introduced here = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: consider further restricting this bound with trait `MyFn<i32>` +help: consider further restricting this bound with trait `MyFn` | LL | F: Callback<Self::CallbackArg> + MyFn<i32>, | +++++++++++ @@ -121,7 +121,7 @@ LL | impl<A, F: MyFn<A>> Callback<A> for F { | | | unsatisfied trait bound introduced here = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: consider further restricting this bound with trait `MyFn<i32>` +help: consider further restricting this bound with trait `MyFn` | LL | F: Callback<Self::CallbackArg> + MyFn<i32>, | +++++++++++ @@ -137,7 +137,7 @@ note: required by a bound in `Callback` | LL | trait Callback<A>: MyFn<A, Output = Self::Ret> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Callback` -help: consider further restricting this bound with trait `MyFn<i32>` +help: consider further restricting this bound with trait `MyFn` | LL | F: Callback<Self::CallbackArg> + MyFn<i32>, | +++++++++++ diff --git a/tests/ui/impl-trait/issue-55872-1.stderr b/tests/ui/impl-trait/issue-55872-1.stderr index caca075a600..28bbb45c096 100644 --- a/tests/ui/impl-trait/issue-55872-1.stderr +++ b/tests/ui/impl-trait/issue-55872-1.stderr @@ -17,7 +17,7 @@ LL | (S::default(), T::default()) | ---------------------------- return type was inferred to be `(S, T)` here | = note: required because it appears within the type `(S, T)` -help: consider further restricting this bound with trait `std::marker::Copy` +help: consider further restricting this bound with trait `Copy` | LL | impl<S: Default + std::marker::Copy> Bar for S { | +++++++++++++++++++ @@ -32,7 +32,7 @@ LL | (S::default(), T::default()) | ---------------------------- return type was inferred to be `(S, T)` here | = note: required because it appears within the type `(S, T)` -help: consider further restricting this bound with trait `std::marker::Copy` +help: consider further restricting this bound with trait `Copy` | LL | fn foo<T: Default + std::marker::Copy>() -> Self::E { | +++++++++++++++++++ |
