about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs8
-rw-r--r--tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr23
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.next.stderr23
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.rs7
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.stderr26
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.current.stderr25
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.next.stderr4
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.old.stderr26
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.rs3
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr26
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr8
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs8
-rw-r--r--tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.next.stderr6
-rw-r--r--tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.old.stderr23
-rw-r--r--tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.rs3
-rw-r--r--tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.old.stderr21
-rw-r--r--tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.rs6
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr22
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs6
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr59
-rw-r--r--tests/ui/implied-bounds/issue-100690.rs5
-rw-r--r--tests/ui/implied-bounds/issue-100690.stderr47
-rw-r--r--tests/ui/issues/issue-23024.stderr2
-rw-r--r--tests/ui/issues/issue-28344.stderr4
24 files changed, 143 insertions, 248 deletions
diff --git a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs
new file mode 100644
index 00000000000..69a4c13530b
--- /dev/null
+++ b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs
@@ -0,0 +1,8 @@
+trait MyIterator : Iterator {}
+
+fn main() {
+    let _ = MyIterator::next;
+}
+//~^^ ERROR the value of the associated type `Item` in `Iterator` must be specified [E0191]
+//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
diff --git a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr
new file mode 100644
index 00000000000..68d8adc5a40
--- /dev/null
+++ b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr
@@ -0,0 +1,23 @@
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
+   |
+LL |     let _ = MyIterator::next;
+   |             ^^^^^^^^^^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+   = note: `#[warn(bare_trait_objects)]` on by default
+help: if this is an object-safe trait, use `dyn`
+   |
+LL |     let _ = <dyn MyIterator>::next;
+   |             ++++           +
+
+error[E0191]: the value of the associated type `Item` in `Iterator` must be specified
+  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
+   |
+LL |     let _ = MyIterator::next;
+   |             ^^^^^^^^^^ help: specify the associated type: `MyIterator::<Item = Type>`
+
+error: aborting due to 1 previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0191`.
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.next.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.next.stderr
new file mode 100644
index 00000000000..90391b7b86b
--- /dev/null
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.next.stderr
@@ -0,0 +1,23 @@
+error[E0277]: the trait bound `for<'a> &'a &T: Trait` is not satisfied
+  --> $DIR/candidate-from-env-universe-err-1.rs:27:16
+   |
+LL |     hr_bound::<&T>();
+   |                ^^ the trait `for<'a> Trait` is not implemented for `&'a &T`
+   |
+note: required by a bound in `hr_bound`
+  --> $DIR/candidate-from-env-universe-err-1.rs:14:20
+   |
+LL | fn hr_bound<T>()
+   |    -------- required by a bound in this function
+LL | where
+LL |     for<'a> &'a T: Trait,
+   |                    ^^^^^ required by this bound in `hr_bound`
+help: consider removing the leading `&`-reference
+   |
+LL -     hr_bound::<&T>();
+LL +     hr_bound::<T>();
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.rs b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.rs
index b448f0bdc77..bd251216162 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.rs
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.rs
@@ -1,3 +1,7 @@
+//@ revisions: old next
+//@[next] compile-flags: -Znext-solver
+//@[old] check-pass
+
 // cc #119820
 
 trait Trait {}
@@ -21,8 +25,7 @@ where
     // the leak check both candidates may apply and we prefer the
     // `param_env` candidate in winnowing.
     hr_bound::<&T>();
-    //~^ ERROR the parameter type `T` may not live long enough
-    //~| ERROR implementation of `Trait` is not general enough
+    //[next]~^ ERROR the trait bound `for<'a> &'a &T: Trait` is not satisfied
 }
 
 fn main() {}
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.stderr
deleted file mode 100644
index febe252d7d1..00000000000
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-1.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/candidate-from-env-universe-err-1.rs:23:5
-   |
-LL |     hr_bound::<&T>();
-   |     ^^^^^^^^^^^^^^
-   |     |
-   |     the parameter type `T` must be valid for the static lifetime...
-   |     ...so that the type `T` will meet its required lifetime bounds
-   |
-help: consider adding an explicit lifetime bound
-   |
-LL |     T: Trait + 'static,
-   |              +++++++++
-
-error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-1.rs:23:5
-   |
-LL |     hr_bound::<&T>();
-   |     ^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `Trait` would have to be implemented for the type `&'0 &T`, for any lifetime `'0`...
-   = note: ...but `Trait` is actually implemented for the type `&'1 &'1 T`, for some specific lifetime `'1`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.current.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.current.stderr
deleted file mode 100644
index 22ce87c0248..00000000000
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.current.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/candidate-from-env-universe-err-2.rs:14:5
-   |
-LL | fn not_hr<'a, T: for<'b> Trait<'a, 'b> + OtherTrait<'static>>() {
-   |           -- lifetime `'a` defined here
-LL |     impl_hr::<T>();
-   |     ^^^^^^^^^^^^ requires that `'a` must outlive `'static`
-   |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/candidate-from-env-universe-err-2.rs:11:19
-   |
-LL | fn impl_hr<'b, T: for<'a> Trait<'a, 'b>>() {}
-   |                   ^^^^^^^^^^^^^^^^^^^^^
-
-error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-2.rs:14:5
-   |
-LL |     impl_hr::<T>();
-   |     ^^^^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `T` must implement `Trait<'0, '_>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Trait<'1, '_>`, for some specific lifetime `'1`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.next.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.next.stderr
index a61bc748bea..8771de85c19 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.next.stderr
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.next.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `for<'a> T: Trait<'a, '_>` is not satisfied
-  --> $DIR/candidate-from-env-universe-err-2.rs:14:5
+  --> $DIR/candidate-from-env-universe-err-2.rs:15:5
    |
 LL |     impl_hr::<T>();
    |     ^^^^^^^^^^^^^^ the trait `for<'a> Trait<'a, '_>` is not implemented for `T`
    |
 note: required by a bound in `impl_hr`
-  --> $DIR/candidate-from-env-universe-err-2.rs:11:19
+  --> $DIR/candidate-from-env-universe-err-2.rs:12:19
    |
 LL | fn impl_hr<'b, T: for<'a> Trait<'a, 'b>>() {}
    |                   ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `impl_hr`
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.old.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.old.stderr
deleted file mode 100644
index 29a72b1c1b6..00000000000
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.old.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/candidate-from-env-universe-err-2.rs:14:5
-   |
-LL | fn not_hr<'a, T: for<'b> Trait<'a, 'b> + OtherTrait<'static>>() {
-   |           -- lifetime `'a` defined here
-LL |     impl_hr::<T>();
-   |     ^^^^^^^^^^^^ requires that `'a` must outlive `'static`
-   |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/candidate-from-env-universe-err-2.rs:11:19
-   |
-LL | fn impl_hr<'b, T: for<'a> Trait<'a, 'b>>() {}
-   |                   ^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-2.rs:14:5
-   |
-LL |     impl_hr::<T>();
-   |     ^^^^^^^^^^^^ one type is more general than the other
-   |
-   = note: expected trait `for<'a> Trait<'a, '_>`
-              found trait `for<'b> Trait<'_, 'b>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.rs b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.rs
index 56fa70469cc..0132b7db605 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.rs
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-2.rs
@@ -1,5 +1,6 @@
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
+//@[current] check-pass
 
 // cc #119820
 
@@ -13,8 +14,6 @@ fn impl_hr<'b, T: for<'a> Trait<'a, 'b>>() {}
 fn not_hr<'a, T: for<'b> Trait<'a, 'b> + OtherTrait<'static>>() {
     impl_hr::<T>();
     //[next]~^ ERROR the trait bound `for<'a> T: Trait<'a, '_>` is not satisfied
-    //[current]~^^ERROR lifetime may not live long enough
-    //[current]~| ERROR implementation of `Trait` is not general enough
 }
 
 fn main() {}
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
index bb0b2de788e..7b9fd6bb4c5 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
@@ -1,23 +1,5 @@
-error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-project.rs:28:5
-   |
-LL |     trait_bound::<T>();
-   |     ^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `T` must implement `Trait<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Trait<'static>`
-
-error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-project.rs:39:5
-   |
-LL |     projection_bound::<T>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
-   |
-   = note: `T` must implement `Trait<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Trait<'static>`
-
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:39:5
+  --> $DIR/candidate-from-env-universe-err-project.rs:38:5
    |
 LL |     projection_bound::<T>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -31,7 +13,7 @@ LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
    |                                          ^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:53:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -40,7 +22,7 @@ LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
               found associated type `<T as Trait<'a>>::Assoc`
 
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:53:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -49,6 +31,6 @@ LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
               found associated type `<T as Trait<'a>>::Assoc`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
index 2804d5bbe94..90df487c07e 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
@@ -15,7 +15,7 @@ LL | fn function1<T: Trait<'static> + for<'a> Trait<'a>>() {
    |                                +++++++++++++++++++
 
 error[E0277]: the trait bound `for<'a> T: Trait<'a>` is not satisfied
-  --> $DIR/candidate-from-env-universe-err-project.rs:39:24
+  --> $DIR/candidate-from-env-universe-err-project.rs:38:24
    |
 LL |     projection_bound::<T>();
    |                        ^ the trait `for<'a> Trait<'a>` is not implemented for `T`
@@ -31,7 +31,7 @@ LL | fn function2<T: Trait<'static, Assoc = usize> + for<'a> Trait<'a>>() {
    |                                               +++++++++++++++++++
 
 error[E0271]: type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
-  --> $DIR/candidate-from-env-universe-err-project.rs:39:24
+  --> $DIR/candidate-from-env-universe-err-project.rs:38:24
    |
 LL |     projection_bound::<T>();
    |                        ^ type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
@@ -48,13 +48,13 @@ LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
    |                                          ^^^^^^^^^^^^^ required by this bound in `projection_bound`
 
 error: higher-ranked subtype error
-  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:53:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: higher-ranked subtype error
-  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:53:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
index e0d2e44e6e7..a77d87f6fa7 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
@@ -1,8 +1,8 @@
 //@ revisions: next current
 //@[next] compile-flags: -Znext-solver
 
-// cc #119820 the previous behavior here was inconsistent as we discarded
-// the where-bound candidate for trait goals due to the leak check, but did
+// cc #119820 the behavior is inconsistent as we discard the where-bound
+// candidate for trait goals due to the leak check, but did
 // not do so for projection candidates and during normalization.
 //
 // This results in an inconsistency between `Trait` and `Projection` goals as
@@ -27,7 +27,6 @@ fn function1<T: Trait<'static>>() {
     // We prefer env candidates over impl candidatescausing this to succeed.
     trait_bound::<T>();
     //[next]~^ ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
-    //[current]~^^ ERROR implementation of `Trait` is not general enough
 }
 
 fn function2<T: Trait<'static, Assoc = usize>>() {
@@ -39,8 +38,7 @@ fn function2<T: Trait<'static, Assoc = usize>>() {
     projection_bound::<T>();
     //[next]~^ ERROR type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
     //[next]~| ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
-    //[current]~^^^ ERROR implementation of `Trait` is not general enough
-    //[current]~| ERROR mismatched types
+    //[current]~^^^ ERROR mismatched types
 }
 
 fn function3<T: Trait<'static, Assoc = usize>>() {
diff --git a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.next.stderr b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.next.stderr
index a840304e49c..cb97bc4b8fc 100644
--- a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.next.stderr
+++ b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.next.stderr
@@ -1,11 +1,11 @@
 error[E0283]: type annotations needed
-  --> $DIR/leak-check-in-selection-2.rs:16:5
+  --> $DIR/leak-check-in-selection-2.rs:17:5
    |
 LL |     impls_trait::<(), _>();
    |     ^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `impls_trait`
    |
 note: multiple `impl`s satisfying `for<'a> (): Trait<&'a str, _>` found
-  --> $DIR/leak-check-in-selection-2.rs:9:1
+  --> $DIR/leak-check-in-selection-2.rs:10:1
    |
 LL | impl<'a> Trait<&'a str, &'a str> for () {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL |
 LL | impl<'a> Trait<&'a str, String> for () {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: required by a bound in `impls_trait`
-  --> $DIR/leak-check-in-selection-2.rs:13:19
+  --> $DIR/leak-check-in-selection-2.rs:14:19
    |
 LL | fn impls_trait<T: for<'a> Trait<&'a str, U>, U>() {}
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `impls_trait`
diff --git a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.old.stderr b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.old.stderr
deleted file mode 100644
index a840304e49c..00000000000
--- a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.old.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0283]: type annotations needed
-  --> $DIR/leak-check-in-selection-2.rs:16:5
-   |
-LL |     impls_trait::<(), _>();
-   |     ^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `impls_trait`
-   |
-note: multiple `impl`s satisfying `for<'a> (): Trait<&'a str, _>` found
-  --> $DIR/leak-check-in-selection-2.rs:9:1
-   |
-LL | impl<'a> Trait<&'a str, &'a str> for () {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-LL |
-LL | impl<'a> Trait<&'a str, String> for () {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `impls_trait`
-  --> $DIR/leak-check-in-selection-2.rs:13:19
-   |
-LL | fn impls_trait<T: for<'a> Trait<&'a str, U>, U>() {}
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `impls_trait`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.rs b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.rs
index 48dd569f201..24e38ec45a2 100644
--- a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.rs
+++ b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-2.rs
@@ -1,5 +1,6 @@
 //@ revisions: old next
 //@[next] compile-flags: -Znext-solver
+//@[old] check-pass
 
 // cc #119820
 
@@ -14,5 +15,5 @@ fn impls_trait<T: for<'a> Trait<&'a str, U>, U>() {}
 
 fn main() {
     impls_trait::<(), _>();
-    //~^ ERROR type annotations needed
+    //[next]~^ ERROR type annotations needed
 }
diff --git a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.old.stderr b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.old.stderr
index 662a0653740..194571dd4a8 100644
--- a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.old.stderr
+++ b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.old.stderr
@@ -1,23 +1,4 @@
 error[E0283]: type annotations needed
-  --> $DIR/leak-check-in-selection-3.rs:18:5
-   |
-LL |     impls_leak::<Box<_>>();
-   |     ^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `impls_leak`
-   |
-note: multiple `impl`s satisfying `for<'a> Box<_>: Leak<'a>` found
-  --> $DIR/leak-check-in-selection-3.rs:9:1
-   |
-LL | impl Leak<'_> for Box<u32> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-LL | impl Leak<'static> for Box<u16> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `impls_leak`
-  --> $DIR/leak-check-in-selection-3.rs:12:18
-   |
-LL | fn impls_leak<T: for<'a> Leak<'a>>() {}
-   |                  ^^^^^^^^^^^^^^^^ required by this bound in `impls_leak`
-
-error[E0283]: type annotations needed
   --> $DIR/leak-check-in-selection-3.rs:35:5
    |
 LL |     impls_indirect_leak::<Box<_>>();
@@ -43,6 +24,6 @@ note: required by a bound in `impls_indirect_leak`
 LL | fn impls_indirect_leak<T: for<'a> IndirectLeak<'a>>() {}
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `impls_indirect_leak`
 
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.rs b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.rs
index 9e99b6c527d..9aa1be57a4f 100644
--- a/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.rs
+++ b/tests/ui/higher-ranked/leak-check/leak-check-in-selection-3.rs
@@ -1,9 +1,9 @@
 //@ revisions: old next
 //@[next] compile-flags: -Znext-solver
 
-// cc #119820, the previous behavior here was inconsistent,
+// cc #119820, the behavior here is  inconsistent,
 // using the leak check to guide inference for `for<'a> Box<_>: Leak<'a>`
-// but not for `for<'a> Box<_>: IndirectLeak<'a>`
+// but not for `for<'a> Box<_>: IndirectLeak<'a>`.
 
 trait Leak<'a> {}
 impl Leak<'_> for Box<u32> {}
@@ -16,7 +16,7 @@ fn direct() {
     // The `Box<u16>` impls fails the leak check,
     // meaning that we apply the `Box<u32>` impl.
     impls_leak::<Box<_>>();
-    //~^ ERROR type annotations needed
+    //[next]~^ ERROR type annotations needed
 }
 
 trait IndirectLeak<'a> {}
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
index be19bf85bd2..e10da26665e 100644
--- a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
@@ -1,11 +1,23 @@
-error: implementation of `Bar` is not general enough
-  --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:5
+error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
+  --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:26
    |
 LL |     want_bar_for_any_ccx(b);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
+   |     -------------------- ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
+   |     |
+   |     required by a bound introduced by this call
    |
-   = note: `B` must implement `Bar<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Bar<'static>`
+note: required by a bound in `want_bar_for_any_ccx`
+  --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:32:15
+   |
+LL | fn want_bar_for_any_ccx<B>(b: &B)
+   |    -------------------- required by a bound in this function
+LL |     where B : for<'ccx> Bar<'ccx>
+   |               ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_bar_for_any_ccx`
+help: consider further restricting this bound
+   |
+LL |     where B : Qux + for<'ccx> Bar<'ccx>
+   |                   +++++++++++++++++++++
 
 error: aborting due to 1 previous error
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs
index 70ce580258d..7e2ecc937bd 100644
--- a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs
@@ -12,8 +12,7 @@ trait Bar<'ccx>: for<'tcx> Foo<'tcx> {
 fn want_foo_for_some_tcx<'x, F: Foo<'x>>(f: &'x F) {
     want_foo_for_some_tcx(f);
     want_foo_for_any_tcx(f);
-    //~^ ERROR lifetime may not live long enough
-    //~| ERROR implementation of `Foo` is not general enough
+    //~^ ERROR the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
 }
 
 fn want_foo_for_any_tcx<F: for<'tcx> Foo<'tcx>>(f: &F) {
@@ -27,8 +26,7 @@ fn want_bar_for_some_ccx<'x, B: Bar<'x>>(b: &B) {
 
     want_bar_for_some_ccx(b);
     want_bar_for_any_ccx(b);
-    //~^ ERROR lifetime may not live long enough
-    //~| ERROR implementation of `Bar` is not general enough
+    //~^ ERROR the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
 }
 
 fn want_bar_for_any_ccx<B: for<'ccx> Bar<'ccx>>(b: &B) {
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr
index dd760926ea1..af76377de85 100644
--- a/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr
@@ -1,50 +1,39 @@
-error: lifetime may not live long enough
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:14:5
+error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:14:26
    |
-LL | fn want_foo_for_some_tcx<'x, F: Foo<'x>>(f: &'x F) {
-   |                          -- lifetime `'x` defined here
-LL |     want_foo_for_some_tcx(f);
 LL |     want_foo_for_any_tcx(f);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ requires that `'x` must outlive `'static`
+   |     -------------------- ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
+   |     |
+   |     required by a bound introduced by this call
    |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:19:28
+note: required by a bound in `want_foo_for_any_tcx`
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:18:28
    |
 LL | fn want_foo_for_any_tcx<F: for<'tcx> Foo<'tcx>>(f: &F) {
-   |                            ^^^^^^^^^^^^^^^^^^^
-
-error: implementation of `Foo` is not general enough
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:14:5
-   |
-LL |     want_foo_for_any_tcx(f);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+   |                            ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_foo_for_any_tcx`
+help: consider further restricting this bound
    |
-   = note: `F` must implement `Foo<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Foo<'1>`, for some specific lifetime `'1`
+LL | fn want_foo_for_some_tcx<'x, F: Foo<'x> + for<'tcx> Foo<'tcx>>(f: &'x F) {
+   |                                         +++++++++++++++++++++
 
-error: lifetime may not live long enough
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:29:5
+error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:28:26
    |
-LL | fn want_bar_for_some_ccx<'x, B: Bar<'x>>(b: &B) {
-   |                          -- lifetime `'x` defined here
-...
 LL |     want_bar_for_any_ccx(b);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ requires that `'x` must outlive `'static`
+   |     -------------------- ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
+   |     |
+   |     required by a bound introduced by this call
    |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:34:28
+note: required by a bound in `want_bar_for_any_ccx`
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:32:28
    |
 LL | fn want_bar_for_any_ccx<B: for<'ccx> Bar<'ccx>>(b: &B) {
-   |                            ^^^^^^^^^^^^^^^^^^^
-
-error: implementation of `Bar` is not general enough
-  --> $DIR/hrtb-higher-ranker-supertraits.rs:29:5
-   |
-LL |     want_bar_for_any_ccx(b);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
+   |                            ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_bar_for_any_ccx`
+help: consider further restricting this bound
    |
-   = note: `B` must implement `Bar<'0>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Bar<'1>`, for some specific lifetime `'1`
+LL | fn want_bar_for_some_ccx<'x, B: Bar<'x> + for<'ccx> Bar<'ccx>>(b: &B) {
+   |                                         +++++++++++++++++++++
 
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/implied-bounds/issue-100690.rs b/tests/ui/implied-bounds/issue-100690.rs
index 041c687ec94..b0dbf749c46 100644
--- a/tests/ui/implied-bounds/issue-100690.rs
+++ b/tests/ui/implied-bounds/issue-100690.rs
@@ -32,10 +32,7 @@ impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandl
         F: FnOnce(&mut UIView<'a, T>) -> Result<(), io::Error> + Send + 'static,
     {
         real_dispatch(f)
-        //~^ ERROR lifetime may not live long enough
-        //~| ERROR implementation of `FnOnce` is not general enough
-        //~| ERROR mismatched types
-        //
+        //~^ ERROR expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F`
     }
 }
 
diff --git a/tests/ui/implied-bounds/issue-100690.stderr b/tests/ui/implied-bounds/issue-100690.stderr
index 2cfd028f255..4964dccd551 100644
--- a/tests/ui/implied-bounds/issue-100690.stderr
+++ b/tests/ui/implied-bounds/issue-100690.stderr
@@ -1,41 +1,22 @@
-error: lifetime may not live long enough
-  --> $DIR/issue-100690.rs:34:9
+error[E0277]: expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F`
+  --> $DIR/issue-100690.rs:34:23
    |
-LL | impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandle<T> {
-   |      -- lifetime `'a` defined here
-...
 LL |         real_dispatch(f)
-   |         ^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+   |         ------------- ^ expected an `FnOnce(&mut UIView<'_, T>)` closure, found `F`
+   |         |
+   |         required by a bound introduced by this call
    |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+   = note: expected a closure with arguments `(&mut UIView<'a, _>,)`
+              found a closure with arguments `(&mut UIView<'_, _>,)`
+note: required by a bound in `real_dispatch`
   --> $DIR/issue-100690.rs:8:8
    |
+LL | fn real_dispatch<T, F>(f: F) -> Result<(), io::Error>
+   |    ------------- required by a bound in this function
+LL | where
 LL |     F: FnOnce(&mut UIView<T>) -> Result<(), io::Error> + Send + 'static,
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `real_dispatch`
 
-error: implementation of `FnOnce` is not general enough
-  --> $DIR/issue-100690.rs:34:9
-   |
-LL |         real_dispatch(f)
-   |         ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
-   |
-   = note: `F` must implement `FnOnce<(&mut UIView<'0, T>,)>`, for any lifetime `'0`...
-   = note: ...but it actually implements `FnOnce<(&mut UIView<'1, T>,)>`, for some specific lifetime `'1`
-
-error[E0308]: mismatched types
-  --> $DIR/issue-100690.rs:34:9
-   |
-LL |         real_dispatch(f)
-   |         ^^^^^^^^^^^^^^^^ one type is more general than the other
-   |
-   = note: expected associated type `<F as FnOnce<(&mut UIView<'_, T>,)>>::Output`
-              found associated type `<F as FnOnce<(&mut UIView<'_, T>,)>>::Output`
-note: the lifetime requirement is introduced here
-  --> $DIR/issue-100690.rs:8:34
-   |
-LL |     F: FnOnce(&mut UIView<T>) -> Result<(), io::Error> + Send + 'static,
-   |                                  ^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-23024.stderr b/tests/ui/issues/issue-23024.stderr
index 1672622d8b7..62278a51be6 100644
--- a/tests/ui/issues/issue-23024.stderr
+++ b/tests/ui/issues/issue-23024.stderr
@@ -23,7 +23,7 @@ error[E0191]: the value of the associated type `Output` in `FnOnce` must be spec
   --> $DIR/issue-23024.rs:8:39
    |
 LL |     println!("{:?}",(vfnfer[0] as dyn Fn)(3));
-   |                                       ^^ help: specify the associated type: `Fn<Output = Type>`
+   |                                       ^^ help: specify the associated type: `Fn::<Output = Type>`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/issues/issue-28344.stderr b/tests/ui/issues/issue-28344.stderr
index d30fb3cfe58..b7e0790f679 100644
--- a/tests/ui/issues/issue-28344.stderr
+++ b/tests/ui/issues/issue-28344.stderr
@@ -16,7 +16,7 @@ error[E0191]: the value of the associated type `Output` in `BitXor` must be spec
   --> $DIR/issue-28344.rs:4:17
    |
 LL |     let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
-   |                 ^^^^^^ help: specify the associated type: `BitXor<Output = Type>`
+   |                 ^^^^^^ help: specify the associated type: `BitXor::<Output = Type>`
 
 error[E0599]: no function or associated item named `bitor` found for trait object `dyn BitXor<_>` in the current scope
   --> $DIR/issue-28344.rs:4:25
@@ -44,7 +44,7 @@ error[E0191]: the value of the associated type `Output` in `BitXor` must be spec
   --> $DIR/issue-28344.rs:10:13
    |
 LL |     let g = BitXor::bitor;
-   |             ^^^^^^ help: specify the associated type: `BitXor<Output = Type>`
+   |             ^^^^^^ help: specify the associated type: `BitXor::<Output = Type>`
 
 error[E0599]: no function or associated item named `bitor` found for trait object `dyn BitXor<_>` in the current scope
   --> $DIR/issue-28344.rs:10:21