about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-23 14:07:05 +0000
committerbors <bors@rust-lang.org>2024-04-23 14:07:05 +0000
commitcd90d5c03532da6f7ca7dcfb861ffabdc36a9d00 (patch)
tree5df57809bb6075b7a98ed26cb2623738224d457c /tests
parentad07aa12c99698f810d730d7b5a49704c729651d (diff)
parent8995c2c4a20197358605c3dad609e39f90a75ce8 (diff)
downloadrust-cd90d5c03532da6f7ca7dcfb861ffabdc36a9d00.tar.gz
rust-cd90d5c03532da6f7ca7dcfb861ffabdc36a9d00.zip
Auto merge of #122317 - compiler-errors:fulfill-method-probe, r=lcnr
Use fulfillment in method probe, not evaluation

This PR reworks method probing to use fulfillment instead of a `for`-loop of `evaluate_predicate` calls, and moves normalization from method candidate assembly into the `consider_probe`, where it's applied to *all* candidates. This last part coincidentally fixes https://github.com/rust-lang/rust/issues/121643#issuecomment-1975371248.

Regarding *why* this large rewrite is done: In general, it's an anti-pattern to do `for o in obligations { evaluate(o); }` because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

r? lcnr
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/derives/issue-91550.stderr27
-rw-r--r--tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs2
-rw-r--r--tests/ui/impl-trait/issues/issue-62742.rs11
-rw-r--r--tests/ui/impl-trait/issues/issue-62742.stderr44
-rw-r--r--tests/ui/impl-trait/issues/issue-84073.rs3
-rw-r--r--tests/ui/impl-trait/issues/issue-84073.stderr4
-rw-r--r--tests/ui/methods/fulfillment-disqualifies-method.rs32
-rw-r--r--tests/ui/methods/leak-check-disquality.rs26
-rw-r--r--tests/ui/methods/self-type-is-sup-no-eq.rs24
-rw-r--r--tests/ui/missing-trait-bounds/issue-35677.stderr2
-rw-r--r--tests/ui/nll/issue-57362-2.rs4
-rw-r--r--tests/ui/nll/issue-57362-2.stderr8
-rw-r--r--tests/ui/nll/issue-57642-higher-ranked-subtype.rs3
-rw-r--r--tests/ui/nll/issue-57642-higher-ranked-subtype.stderr8
-rw-r--r--tests/ui/suggestions/derive-trait-for-method-call.stderr24
-rw-r--r--tests/ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.stderr7
-rw-r--r--tests/ui/traits/track-obligations.stderr30
17 files changed, 147 insertions, 112 deletions
diff --git a/tests/ui/derives/issue-91550.stderr b/tests/ui/derives/issue-91550.stderr
index 9e171896718..4d637c97283 100644
--- a/tests/ui/derives/issue-91550.stderr
+++ b/tests/ui/derives/issue-91550.stderr
@@ -2,15 +2,13 @@ error[E0599]: the method `insert` exists for struct `HashSet<Value>`, but its tr
   --> $DIR/issue-91550.rs:8:8
    |
 LL | struct Value(u32);
-   | ------------ doesn't satisfy `Value: Eq`, `Value: Hash` or `Value: PartialEq`
+   | ------------ doesn't satisfy `Value: Eq` or `Value: Hash`
 ...
 LL |     hs.insert(Value(0));
    |        ^^^^^^
    |
    = note: the following trait bounds were not satisfied:
            `Value: Eq`
-           `Value: PartialEq`
-           which is required by `Value: Eq`
            `Value: Hash`
 help: consider annotating `Value` with `#[derive(Eq, Hash, PartialEq)]`
    |
@@ -22,7 +20,7 @@ error[E0599]: the method `use_eq` exists for struct `Object<NoDerives>`, but its
   --> $DIR/issue-91550.rs:26:9
    |
 LL | pub struct NoDerives;
-   | -------------------- doesn't satisfy `NoDerives: Eq` or `NoDerives: PartialEq`
+   | -------------------- doesn't satisfy `NoDerives: Eq`
 LL |
 LL | struct Object<T>(T);
    | ---------------- method `use_eq` not found for this struct
@@ -37,9 +35,6 @@ LL | impl<T: Eq> Object<T> {
    |         ^^  ---------
    |         |
    |         unsatisfied trait bound introduced here
-   = note: the following trait bounds were not satisfied:
-           `NoDerives: PartialEq`
-           which is required by `NoDerives: Eq`
 help: consider annotating `NoDerives` with `#[derive(Eq, PartialEq)]`
    |
 LL + #[derive(Eq, PartialEq)]
@@ -50,7 +45,7 @@ error[E0599]: the method `use_ord` exists for struct `Object<NoDerives>`, but it
   --> $DIR/issue-91550.rs:27:9
    |
 LL | pub struct NoDerives;
-   | -------------------- doesn't satisfy `NoDerives: Eq`, `NoDerives: Ord`, `NoDerives: PartialEq` or `NoDerives: PartialOrd`
+   | -------------------- doesn't satisfy `NoDerives: Ord`
 LL |
 LL | struct Object<T>(T);
    | ---------------- method `use_ord` not found for this struct
@@ -65,13 +60,6 @@ LL | impl<T: Ord> Object<T> {
    |         ^^^  ---------
    |         |
    |         unsatisfied trait bound introduced here
-   = note: the following trait bounds were not satisfied:
-           `NoDerives: PartialOrd`
-           which is required by `NoDerives: Ord`
-           `NoDerives: PartialEq`
-           which is required by `NoDerives: Ord`
-           `NoDerives: Eq`
-           which is required by `NoDerives: Ord`
 help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
    |
 LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
@@ -82,7 +70,7 @@ error[E0599]: the method `use_ord_and_partial_ord` exists for struct `Object<NoD
   --> $DIR/issue-91550.rs:28:9
    |
 LL | pub struct NoDerives;
-   | -------------------- doesn't satisfy `NoDerives: Eq`, `NoDerives: Ord`, `NoDerives: PartialEq` or `NoDerives: PartialOrd`
+   | -------------------- doesn't satisfy `NoDerives: Ord` or `NoDerives: PartialOrd`
 LL |
 LL | struct Object<T>(T);
    | ---------------- method `use_ord_and_partial_ord` not found for this struct
@@ -100,13 +88,6 @@ LL | impl<T: Ord + PartialOrd> Object<T> {
    |         |     |
    |         |     unsatisfied trait bound introduced here
    |         unsatisfied trait bound introduced here
-   = note: the following trait bounds were not satisfied:
-           `NoDerives: PartialEq`
-           which is required by `NoDerives: Ord`
-           `NoDerives: Eq`
-           which is required by `NoDerives: Ord`
-           `NoDerives: PartialEq`
-           which is required by `NoDerives: PartialOrd`
 help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
    |
 LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
diff --git a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs
index 86da6ebfaaa..d7dff329df1 100644
--- a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs
+++ b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs
@@ -29,5 +29,5 @@ where
 
 fn main() {
     let mut list = RcNode::<i32>::new();
-    //~^ ERROR trait bounds were not satisfied
+    //~^ ERROR the variant or associated item `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied
 }
diff --git a/tests/ui/impl-trait/issues/issue-62742.rs b/tests/ui/impl-trait/issues/issue-62742.rs
index 11a75737e55..56c63a1daa8 100644
--- a/tests/ui/impl-trait/issues/issue-62742.rs
+++ b/tests/ui/impl-trait/issues/issue-62742.rs
@@ -1,12 +1,17 @@
 use std::marker::PhantomData;
 
-fn _alias_check() {
+fn a() {
     WrongImpl::foo(0i32);
-    //~^ ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied
-    //~| ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied
+    //~^ ERROR overflow assigning `_` to `[_]`
+}
+
+fn b() {
     WrongImpl::<()>::foo(0i32);
     //~^ ERROR the trait bound `RawImpl<()>: Raw<()>` is not satisfied
     //~| ERROR trait bounds were not satisfied
+}
+
+fn c() {
     CorrectImpl::foo(0i32);
 }
 
diff --git a/tests/ui/impl-trait/issues/issue-62742.stderr b/tests/ui/impl-trait/issues/issue-62742.stderr
index 9ec581c231b..7a1bcfc70d5 100644
--- a/tests/ui/impl-trait/issues/issue-62742.stderr
+++ b/tests/ui/impl-trait/issues/issue-62742.stderr
@@ -1,33 +1,11 @@
-error[E0277]: the trait bound `RawImpl<_>: Raw<_>` is not satisfied
-  --> $DIR/issue-62742.rs:4:5
+error[E0275]: overflow assigning `_` to `[_]`
+  --> $DIR/issue-62742.rs:4:16
    |
 LL |     WrongImpl::foo(0i32);
-   |     ^^^^^^^^^^^^^^^^^^^^ the trait `Raw<_>` is not implemented for `RawImpl<_>`
-   |
-   = help: the trait `Raw<[_]>` is implemented for `RawImpl<_>`
-note: required by a bound in `SafeImpl::<T, A>::foo`
-  --> $DIR/issue-62742.rs:29:20
-   |
-LL | impl<T: ?Sized, A: Raw<T>> SafeImpl<T, A> {
-   |                    ^^^^^^ required by this bound in `SafeImpl::<T, A>::foo`
-LL |     pub fn foo(value: A::Value) {}
-   |            --- required by a bound in this associated function
-
-error[E0277]: the trait bound `RawImpl<_>: Raw<_>` is not satisfied
-  --> $DIR/issue-62742.rs:4:5
-   |
-LL |     WrongImpl::foo(0i32);
-   |     ^^^^^^^^^ the trait `Raw<_>` is not implemented for `RawImpl<_>`
-   |
-   = help: the trait `Raw<[_]>` is implemented for `RawImpl<_>`
-note: required by a bound in `SafeImpl`
-  --> $DIR/issue-62742.rs:27:35
-   |
-LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
-   |                                   ^^^^^^ required by this bound in `SafeImpl`
+   |                ^^^
 
 error[E0599]: the function or associated item `foo` exists for struct `SafeImpl<(), RawImpl<()>>`, but its trait bounds were not satisfied
-  --> $DIR/issue-62742.rs:7:22
+  --> $DIR/issue-62742.rs:9:22
    |
 LL |     WrongImpl::<()>::foo(0i32);
    |                      ^^^ function or associated item cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds
@@ -39,20 +17,20 @@ LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
    | ----------------------------------------- function or associated item `foo` not found for this struct
    |
 note: trait bound `RawImpl<()>: Raw<()>` was not satisfied
-  --> $DIR/issue-62742.rs:29:20
+  --> $DIR/issue-62742.rs:34:20
    |
 LL | impl<T: ?Sized, A: Raw<T>> SafeImpl<T, A> {
    |                    ^^^^^^  --------------
    |                    |
    |                    unsatisfied trait bound introduced here
 note: the trait `Raw` must be implemented
-  --> $DIR/issue-62742.rs:13:1
+  --> $DIR/issue-62742.rs:18:1
    |
 LL | pub trait Raw<T: ?Sized> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `RawImpl<()>: Raw<()>` is not satisfied
-  --> $DIR/issue-62742.rs:7:5
+  --> $DIR/issue-62742.rs:9:5
    |
 LL |     WrongImpl::<()>::foo(0i32);
    |     ^^^^^^^^^^^^^^^ the trait `Raw<()>` is not implemented for `RawImpl<()>`
@@ -60,12 +38,12 @@ LL |     WrongImpl::<()>::foo(0i32);
    = help: the trait `Raw<[()]>` is implemented for `RawImpl<()>`
    = help: for that trait implementation, expected `[()]`, found `()`
 note: required by a bound in `SafeImpl`
-  --> $DIR/issue-62742.rs:27:35
+  --> $DIR/issue-62742.rs:32:35
    |
 LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
    |                                   ^^^^^^ required by this bound in `SafeImpl`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0277, E0599.
-For more information about an error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0275, E0277, E0599.
+For more information about an error, try `rustc --explain E0275`.
diff --git a/tests/ui/impl-trait/issues/issue-84073.rs b/tests/ui/impl-trait/issues/issue-84073.rs
index 85d9d461fd9..7acee44a722 100644
--- a/tests/ui/impl-trait/issues/issue-84073.rs
+++ b/tests/ui/impl-trait/issues/issue-84073.rs
@@ -29,5 +29,6 @@ where
 }
 
 fn main() {
-    Race::new(|race| race.when()); //~ ERROR overflow assigning `_` to `Option<_>`
+    Race::new(|race| race.when());
+    //~^ ERROR overflow assigning `_` to `Option<_>`
 }
diff --git a/tests/ui/impl-trait/issues/issue-84073.stderr b/tests/ui/impl-trait/issues/issue-84073.stderr
index ab119a8a4f4..0f4c6e83fbe 100644
--- a/tests/ui/impl-trait/issues/issue-84073.stderr
+++ b/tests/ui/impl-trait/issues/issue-84073.stderr
@@ -1,8 +1,8 @@
 error[E0275]: overflow assigning `_` to `Option<_>`
-  --> $DIR/issue-84073.rs:32:22
+  --> $DIR/issue-84073.rs:32:27
    |
 LL |     Race::new(|race| race.when());
-   |                      ^^^^
+   |                           ^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/fulfillment-disqualifies-method.rs b/tests/ui/methods/fulfillment-disqualifies-method.rs
new file mode 100644
index 00000000000..639e1c7fc5c
--- /dev/null
+++ b/tests/ui/methods/fulfillment-disqualifies-method.rs
@@ -0,0 +1,32 @@
+// Tests that using fulfillment in the trait solver means that we detect that a
+// method is impossible, leading to no ambiguity.
+//@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
+#[derive(Default)]
+struct W<A, B>(A, B);
+
+trait Constrain {
+    type Output;
+}
+
+impl Constrain for i32 {
+    type Output = u32;
+}
+
+trait Impossible {}
+
+impl<A, B> W<A, B> where A: Constrain<Output = B>, B: Impossible {
+    fn method(&self) {}
+}
+
+impl W<i32, u32> {
+    fn method(&self) {}
+}
+
+fn main() {
+    let w: W<i32, _> = W::default();
+    w.method();
+}
diff --git a/tests/ui/methods/leak-check-disquality.rs b/tests/ui/methods/leak-check-disquality.rs
new file mode 100644
index 00000000000..d3b7dd4b807
--- /dev/null
+++ b/tests/ui/methods/leak-check-disquality.rs
@@ -0,0 +1,26 @@
+// Tests that using fulfillment in the trait solver means that we detect that a
+// method is impossible, leading to no ambiguity.
+//@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
+struct W<T, U>(Option<T>, Option<U>);
+
+impl<'a> W<fn(&'a ()), u32> {
+    fn method(&self) {}
+}
+
+trait Leak {}
+impl<T: Fn(&())> Leak for T {}
+
+impl<T: Leak> W<T, i32> {
+    fn method(&self) {}
+}
+
+fn test<'a>() {
+    let x: W<fn(&'a ()), _> = W(None, None);
+    x.method();
+}
+
+fn main() {}
diff --git a/tests/ui/methods/self-type-is-sup-no-eq.rs b/tests/ui/methods/self-type-is-sup-no-eq.rs
new file mode 100644
index 00000000000..ec28b964a05
--- /dev/null
+++ b/tests/ui/methods/self-type-is-sup-no-eq.rs
@@ -0,0 +1,24 @@
+//@ check-pass
+
+// Test that we use `sup` not `eq` during method probe, since this has an effect
+// on the leak check. This is (conceptually) minimized from a crater run for
+// `wrend 0.3.6`.
+
+use std::ops::Deref;
+
+struct A;
+
+impl Deref for A {
+    type Target = B<dyn Fn(&())>;
+
+    fn deref(&self) -> &<Self as Deref>::Target { todo!() }
+}
+
+struct B<T: ?Sized>(T);
+impl<T> B<dyn Fn(T)> {
+    fn method(&self) {}
+}
+
+fn main() {
+    A.method();
+}
diff --git a/tests/ui/missing-trait-bounds/issue-35677.stderr b/tests/ui/missing-trait-bounds/issue-35677.stderr
index f73bff51e7a..3bfdd4da6da 100644
--- a/tests/ui/missing-trait-bounds/issue-35677.stderr
+++ b/tests/ui/missing-trait-bounds/issue-35677.stderr
@@ -6,8 +6,6 @@ LL |     this.is_subset(other)
    |
    = note: the following trait bounds were not satisfied:
            `T: Eq`
-           `T: PartialEq`
-           which is required by `T: Eq`
            `T: Hash`
 help: consider restricting the type parameters to satisfy the trait bounds
    |
diff --git a/tests/ui/nll/issue-57362-2.rs b/tests/ui/nll/issue-57362-2.rs
index a0b0ea1d038..664cdf89a38 100644
--- a/tests/ui/nll/issue-57362-2.rs
+++ b/tests/ui/nll/issue-57362-2.rs
@@ -18,8 +18,10 @@ impl<'a> X for fn(&'a ()) {
     }
 }
 
+// FIXME(@compiler-errors): This error message is less than helpful.
 fn g() {
-    let x = <fn (&())>::make_g(); //~ ERROR the function
+    let x = <fn (&())>::make_g();
+    //~^ ERROR no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope
 }
 
 fn main() {}
diff --git a/tests/ui/nll/issue-57362-2.stderr b/tests/ui/nll/issue-57362-2.stderr
index 57477f5341e..24787b990e3 100644
--- a/tests/ui/nll/issue-57362-2.stderr
+++ b/tests/ui/nll/issue-57362-2.stderr
@@ -1,11 +1,9 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied
-  --> $DIR/issue-57362-2.rs:22:25
+error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope
+  --> $DIR/issue-57362-2.rs:23:25
    |
 LL |     let x = <fn (&())>::make_g();
-   |                         ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
+   |                         ^^^^^^ function or associated item not found in `fn(&())`
    |
-   = note: the following trait bounds were not satisfied:
-           `for<'a> fn(&'a ()): X`
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `X` defines an item `make_g`, perhaps you need to implement it
   --> $DIR/issue-57362-2.rs:8:1
diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.rs b/tests/ui/nll/issue-57642-higher-ranked-subtype.rs
index eba859cde22..69187cab342 100644
--- a/tests/ui/nll/issue-57642-higher-ranked-subtype.rs
+++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.rs
@@ -28,7 +28,8 @@ impl<T> Y for fn(T) {
 }
 
 fn higher_ranked_region_has_lost_its_binder() {
-    let x = <fn (&())>::make_g(); //~ ERROR the function
+    let x = <fn (&())>::make_g();
+    //~^ ERROR no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope
 }
 
 fn magical() {
diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
index d1e94bc702c..998d06b7706 100644
--- a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
+++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
@@ -1,11 +1,9 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied
+error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope
   --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
    |
 LL |     let x = <fn (&())>::make_g();
-   |                         ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
+   |                         ^^^^^^ function or associated item not found in `fn(&())`
    |
-   = note: the following trait bounds were not satisfied:
-           `for<'a> fn(&'a ()): X`
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `X` defines an item `make_g`, perhaps you need to implement it
   --> $DIR/issue-57642-higher-ranked-subtype.rs:4:1
@@ -14,7 +12,7 @@ LL | trait X {
    | ^^^^^^^
 
 error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope
-  --> $DIR/issue-57642-higher-ranked-subtype.rs:35:25
+  --> $DIR/issue-57642-higher-ranked-subtype.rs:36:25
    |
 LL |     let x = <fn (&())>::make_f();
    |                         ^^^^^^ function or associated item not found in `fn(&())`
diff --git a/tests/ui/suggestions/derive-trait-for-method-call.stderr b/tests/ui/suggestions/derive-trait-for-method-call.stderr
index 9d6d29ec74e..ae3a0391eea 100644
--- a/tests/ui/suggestions/derive-trait-for-method-call.stderr
+++ b/tests/ui/suggestions/derive-trait-for-method-call.stderr
@@ -74,22 +74,30 @@ LL | struct Struct {
 error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
   --> $DIR/derive-trait-for-method-call.rs:40:15
    |
+LL | enum Enum {
+   | --------- doesn't satisfy `Enum: Clone`
+...
 LL | struct Foo<X, Y> (X, Y);
    | ---------------- method `test` not found for this struct
 ...
 LL |     let y = x.test();
    |               ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds
    |
-note: the following trait bounds were not satisfied:
-      `Instant: Default`
-      `Vec<Enum>: Clone`
-  --> $DIR/derive-trait-for-method-call.rs:20:9
+note: trait bound `Instant: Default` was not satisfied
+  --> $DIR/derive-trait-for-method-call.rs:20:40
    |
 LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
-   |         ^^^^^                          ^^^^^^^  ---------
-   |         |                              |
-   |         |                              unsatisfied trait bound introduced here
-   |         unsatisfied trait bound introduced here
+   |                                        ^^^^^^^  ---------
+   |                                        |
+   |                                        unsatisfied trait bound introduced here
+   = note: the following trait bounds were not satisfied:
+           `Enum: Clone`
+           which is required by `Vec<Enum>: Clone`
+help: consider annotating `Enum` with `#[derive(Clone)]`
+   |
+LL + #[derive(Clone)]
+LL | enum Enum {
+   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.stderr b/tests/ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.stderr
index 74526b4dbc1..49a4db7491e 100644
--- a/tests/ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.stderr
+++ b/tests/ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.stderr
@@ -12,13 +12,6 @@ note: trait bound `(): Iterator` was not satisfied
    |
 LL | trait IteratorAlias = Iterator;
    |       -------------   ^^^^^^^^ unsatisfied trait bound introduced here
-note: trait bound `(): IteratorAlias` was not satisfied
-  --> $DIR/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs:9:9
-   |
-LL | impl<I: IteratorAlias> Foo<I> {
-   |         ^^^^^^^^^^^^^  ------
-   |         |
-   |         unsatisfied trait bound introduced here
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/track-obligations.stderr b/tests/ui/traits/track-obligations.stderr
index 822fc91e43f..141f565077a 100644
--- a/tests/ui/traits/track-obligations.stderr
+++ b/tests/ui/traits/track-obligations.stderr
@@ -2,7 +2,10 @@ error[E0599]: the method `check` exists for struct `Client<()>`, but its trait b
   --> $DIR/track-obligations.rs:83:16
    |
 LL | struct ALayer<C>(C);
-   | ---------------- doesn't satisfy `<_ as Layer<()>>::Service = <ALayer<()> as ParticularServiceLayer<()>>::Service` or `ALayer<()>: ParticularServiceLayer<()>`
+   | ---------------- doesn't satisfy `ALayer<()>: ParticularServiceLayer<()>`
+...
+LL | struct AService;
+   | --------------- doesn't satisfy `<AService as Service<Req>>::Response = Res`
 ...
 LL | struct Client<C>(C);
    | ---------------- method `check` not found for this struct
@@ -10,27 +13,14 @@ LL | struct Client<C>(C);
 LL |     Client(()).check();
    |                ^^^^^ method cannot be called on `Client<()>` due to unsatisfied trait bounds
    |
-note: trait bound `<ALayer<()> as Layer<()>>::Service = <ALayer<()> as ParticularServiceLayer<()>>::Service` was not satisfied
-  --> $DIR/track-obligations.rs:35:14
-   |
-LL | pub trait ParticularServiceLayer<C>:
-   |           ----------------------
-LL |     Layer<C, Service = <Self as ParticularServiceLayer<C>>::Service>
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound introduced here
-note: trait bound `ALayer<()>: ParticularServiceLayer<()>` was not satisfied
-  --> $DIR/track-obligations.rs:71:16
+note: trait bound `<AService as Service<Req>>::Response = Res` was not satisfied
+  --> $DIR/track-obligations.rs:24:21
    |
-LL | impl<C> Client<C>
-   |         ---------
+LL | impl<T> ParticularService for T
+   |         -----------------     -
 LL | where
-LL |     ALayer<C>: ParticularServiceLayer<C>,
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound introduced here
-note: the trait `ParticularServiceLayer` must be implemented
-  --> $DIR/track-obligations.rs:34:1
-   |
-LL | / pub trait ParticularServiceLayer<C>:
-LL | |     Layer<C, Service = <Self as ParticularServiceLayer<C>>::Service>
-   | |____________________________________________________________________^
+LL |     T: Service<Req, Response = Res>,
+   |                     ^^^^^^^^^^^^^^ unsatisfied trait bound introduced here
 
 error[E0271]: type mismatch resolving `<AService as Service<Req>>::Response == Res`
   --> $DIR/track-obligations.rs:87:11