about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/anonymous-higher-ranked-lifetime.rs11
-rw-r--r--src/test/ui/anonymous-higher-ranked-lifetime.stderr196
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.rs8
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.stderr95
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.bad.stderr15
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.good.stderr2
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.rs2
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.rs6
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr57
-rw-r--r--src/test/ui/coherence/coherence-subtyping.old.stderr14
-rw-r--r--src/test/ui/coherence/coherence-subtyping.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence-subtyping.rs6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr2
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr22
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr2
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr22
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr22
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr22
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr2
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr6
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.rs8
-rw-r--r--src/test/ui/hrtb/hrtb-conflate-regions.stderr18
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-fn.stderr2
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs7
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr21
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs7
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr21
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs2
-rw-r--r--src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr21
-rw-r--r--src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr17
-rw-r--r--src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs4
-rw-r--r--src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr41
-rw-r--r--src/test/ui/hrtb/hrtb-just-for-static.stderr35
-rw-r--r--src/test/ui/hrtb/issue-46989.rs42
-rw-r--r--src/test/ui/hrtb/issue-46989.stderr17
-rw-r--r--src/test/ui/hrtb/issue-57639.rs29
-rw-r--r--src/test/ui/hrtb/issue-58451.rs13
-rw-r--r--src/test/ui/hrtb/issue-58451.stderr16
-rw-r--r--src/test/ui/issues/issue-40000.stderr6
-rw-r--r--src/test/ui/issues/issue-57362-1.rs2
-rw-r--r--src/test/ui/issues/issue-57362-1.stderr11
-rw-r--r--src/test/ui/issues/issue-57362-2.rs2
-rw-r--r--src/test/ui/issues/issue-57362-2.stderr16
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr.rs5
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr.stderr18
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-object.rs4
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-object.stderr18
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.rs4
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr33
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.rs3
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.stderr34
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.rs1
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr10
-rw-r--r--src/test/ui/regions-fn-subtyping-return-static-fail.rs4
-rw-r--r--src/test/ui/regions-fn-subtyping-return-static-fail.stderr17
-rw-r--r--src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr4
-rw-r--r--src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr4
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static.rs4
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static.stderr12
-rw-r--r--src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr4
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr34
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr34
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr34
-rw-r--r--src/test/ui/where-clauses/where-for-self-2.rs2
-rw-r--r--src/test/ui/where-clauses/where-for-self-2.stderr19
72 files changed, 924 insertions, 292 deletions
diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.rs b/src/test/ui/anonymous-higher-ranked-lifetime.rs
index 55b1667da50..2e2a124db9a 100644
--- a/src/test/ui/anonymous-higher-ranked-lifetime.rs
+++ b/src/test/ui/anonymous-higher-ranked-lifetime.rs
@@ -1,15 +1,26 @@
 fn main() {
     f1(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     f2(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     f3(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     f4(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     f5(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     g1(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     g2(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     g3(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     g4(|_: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
     h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
 }
 
 // Basic
diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
index d2c722e32b2..378f352cb92 100644
--- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr
+++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
@@ -7,13 +7,27 @@ LL |     f1(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
    |
 note: required by `f1`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:16:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:27:1
    |
 LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
+   |
+LL |     f1(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), &()) -> _`
+   |
+note: required by `f1`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:27:1
+   |
+LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
    |
 LL |     f2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -21,7 +35,7 @@ LL |     f2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
    |
 note: required by `f2`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:17:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:28:1
    |
 LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -29,19 +43,47 @@ LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
    |
+LL |     f2(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&'a (), &()) -> _`
+   |
+note: required by `f2`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:28:1
+   |
+LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
+   |
 LL |     f3(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r> fn(&(), &'r ()) -> _`
    |
 note: required by `f3`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:18:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:29:1
    |
 LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
+   |
+LL |     f3(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), &()) -> _`
+   |
+note: required by `f3`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:29:1
+   |
+LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
    |
 LL |     f4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -49,13 +91,27 @@ LL |     f4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
    |
 note: required by `f4`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:19:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:30:1
    |
 LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
+   |
+LL |     f4(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), &'r ()) -> _`
+   |
+note: required by `f4`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:30:1
+   |
+LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
    |
 LL |     f5(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -63,13 +119,27 @@ LL |     f5(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
    |
 note: required by `f5`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:20:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:31:1
    |
 LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
+   |
+LL |     f5(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&'r (), &'r ()) -> _`
+   |
+note: required by `f5`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:31:1
+   |
+LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
    |
 LL |     g1(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -77,13 +147,27 @@ LL |     g1(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _`
    |
 note: required by `g1`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:23:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
    |
 LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
+   |
+LL |     g1(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
+   |
+note: required by `g1`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
+   |
+LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
    |
 LL |     g2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -91,13 +175,27 @@ LL |     g2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
    |
 note: required by `g2`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:24:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:35:1
    |
 LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
+   |
+LL |     g2(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
+   |
+note: required by `g2`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:35:1
+   |
+LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
    |
 LL |     g3(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -105,13 +203,27 @@ LL |     g3(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
    |
 note: required by `g3`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:25:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
    |
 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
+   |
+LL |     g3(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
+   |
+note: required by `g3`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
+   |
+LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
    |
 LL |     g4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ -------------- found signature of `fn((), ()) -> _`
@@ -119,13 +231,27 @@ LL |     g4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
    |
 note: required by `g4`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:26:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:37:1
+   |
+LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
+   |
+LL |     g4(|_: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ -------------- found signature of `fn((), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
+   |
+note: required by `g4`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:37:1
    |
 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
    |
 LL |     h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
@@ -133,13 +259,27 @@ LL |     h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
    |
 note: required by `h1`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:29:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
    |
 LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
+   |
+LL |     h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &(), for<'r, 's> fn(&'r (), &'s ())) -> _`
+   |
+note: required by `h1`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
+   |
+LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
    |
 LL |     h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
@@ -147,11 +287,25 @@ LL |     h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
    |
 note: required by `h2`
-  --> $DIR/anonymous-higher-ranked-lifetime.rs:30:1
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:41:1
+   |
+LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
+   |
+LL |     h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
+   |     ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
+   |     |
+   |     expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _`
+   |
+note: required by `h2`
+  --> $DIR/anonymous-higher-ranked-lifetime.rs:41:1
    |
 LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 11 previous errors
+error: aborting due to 22 previous errors
 
 For more information about this error, try `rustc --explain E0631`.
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.rs b/src/test/ui/associated-types/associated-types-eq-hr.rs
index 20fa1e7a48d..e6afa3f71c2 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.rs
+++ b/src/test/ui/associated-types/associated-types-eq-hr.rs
@@ -89,12 +89,14 @@ pub fn call_bar() {
 
 pub fn call_tuple_one() {
     tuple_one::<Tuple>();
-    //~^ ERROR not general enough
+    //~^ ERROR not satisfied
+    //~| ERROR type mismatch
 }
 
 pub fn call_tuple_two() {
     tuple_two::<Tuple>();
-    //~^ ERROR not general enough
+    //~^ ERROR not satisfied
+    //~| ERROR type mismatch
 }
 
 pub fn call_tuple_three() {
@@ -103,7 +105,7 @@ pub fn call_tuple_three() {
 
 pub fn call_tuple_four() {
     tuple_four::<Tuple>();
-    //~^ ERROR not general enough
+    //~^ ERROR not satisfied
 }
 
 fn main() { }
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr
index 5299ebbb1ba..3721b698988 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr
@@ -34,36 +34,93 @@ LL | |     // ok for UintStruct, but not IntStruct
 LL | | }
    | |_^
 
-error: implementation of `TheTrait` is not general enough
+error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
   --> $DIR/associated-types-eq-hr.rs:91:5
    |
 LL |     tuple_one::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
    |
-   = note: Due to a where-clause on `tuple_one`,
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
-   = note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+   = help: the following implementations were found:
+             <Tuple as TheTrait<(&'a isize, &'a isize)>>
+note: required by `tuple_one`
+  --> $DIR/associated-types-eq-hr.rs:56:1
+   |
+LL | / fn tuple_one<T>()
+LL | |     where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
+LL | | {
+LL | |     // not ok for tuple, two lifetimes and we pick first
+LL | | }
+   | |_^
 
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:96:5
+error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'x isize`
+  --> $DIR/associated-types-eq-hr.rs:91:5
+   |
+LL |     tuple_one::<Tuple>();
+   |     ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
+   |
+note: required by `tuple_one`
+  --> $DIR/associated-types-eq-hr.rs:56:1
+   |
+LL | / fn tuple_one<T>()
+LL | |     where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
+LL | | {
+LL | |     // not ok for tuple, two lifetimes and we pick first
+LL | | }
+   | |_^
+
+error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
+  --> $DIR/associated-types-eq-hr.rs:97:5
    |
 LL |     tuple_two::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
+   |
+   = help: the following implementations were found:
+             <Tuple as TheTrait<(&'a isize, &'a isize)>>
+note: required by `tuple_two`
+  --> $DIR/associated-types-eq-hr.rs:62:1
    |
-   = note: Due to a where-clause on `tuple_two`,
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
-   = note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+LL | / fn tuple_two<T>()
+LL | |     where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
+LL | | {
+LL | |     // not ok for tuple, two lifetimes and we pick second
+LL | | }
+   | |_^
+
+error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'y isize`
+  --> $DIR/associated-types-eq-hr.rs:97:5
+   |
+LL |     tuple_two::<Tuple>();
+   |     ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
+   |
+note: required by `tuple_two`
+  --> $DIR/associated-types-eq-hr.rs:62:1
+   |
+LL | / fn tuple_two<T>()
+LL | |     where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
+LL | | {
+LL | |     // not ok for tuple, two lifetimes and we pick second
+LL | | }
+   | |_^
 
-error: implementation of `TheTrait` is not general enough
-  --> $DIR/associated-types-eq-hr.rs:105:5
+error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
+  --> $DIR/associated-types-eq-hr.rs:107:5
    |
 LL |     tuple_four::<Tuple>();
-   |     ^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
+   |
+   = help: the following implementations were found:
+             <Tuple as TheTrait<(&'a isize, &'a isize)>>
+note: required by `tuple_four`
+  --> $DIR/associated-types-eq-hr.rs:74:1
    |
-   = note: Due to a where-clause on `tuple_four`,
-   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
-   = note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+LL | / fn tuple_four<T>()
+LL | |     where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)>
+LL | | {
+LL | |     // not ok for tuple, two lifetimes, and lifetime matching is invariant
+LL | | }
+   | |_^
 
-error: aborting due to 5 previous errors
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0271`.
+Some errors occurred: E0271, E0277.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
index 811c9a8f5e1..cc69e849fe1 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
@@ -1,12 +1,17 @@
-error[E0308]: mismatched types
+error[E0271]: type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _`
   --> $DIR/higher-ranked-projection.rs:25:5
    |
 LL |     foo(());
-   |     ^^^ one type is more general than the other
+   |     ^^^ expected bound lifetime parameter 'a, found concrete lifetime
    |
-   = note: expected type `&'a ()`
-              found type `&()`
+note: required by `foo`
+  --> $DIR/higher-ranked-projection.rs:14:1
+   |
+LL | / fn foo<U, T>(_t: T)
+LL | |     where for<'a> &'a T: Mirror<Image=U>
+LL | | {}
+   | |__^
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.good.stderr b/src/test/ui/associated-types/higher-ranked-projection.good.stderr
index 92fd2562858..165e5213e0d 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.good.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.good.stderr
@@ -3,7 +3,7 @@ error: compilation successful
    |
 LL | / fn main() { //[good]~ ERROR compilation successful
 LL | |     foo(());
-LL | |     //[bad]~^ ERROR mismatched types
+LL | |     //[bad]~^ ERROR type mismatch
 LL | | }
    | |_^
 
diff --git a/src/test/ui/associated-types/higher-ranked-projection.rs b/src/test/ui/associated-types/higher-ranked-projection.rs
index fd7252f9e22..a2ea6d8f206 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.rs
+++ b/src/test/ui/associated-types/higher-ranked-projection.rs
@@ -23,5 +23,5 @@ fn foo<U, T>(_t: T)
 #[rustc_error]
 fn main() { //[good]~ ERROR compilation successful
     foo(());
-    //[bad]~^ ERROR mismatched types
+    //[bad]~^ ERROR type mismatch
 }
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
index 6977fd47a2e..a4e43da91ba 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs
@@ -28,14 +28,14 @@ fn expect_free_supply_bound() {
     // Here, we are given a function whose region is bound at closure level,
     // but we expect one bound in the argument. Error results.
     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
-    //~^ ERROR mismatched types
+    //~^ ERROR type mismatch
 }
 
 fn expect_bound_supply_free_from_fn<'x>(x: &'x u32) {
     // Here, we are given a `fn(&u32)` but we expect a `fn(&'x
     // u32)`. In principle, this could be ok, but we demand equality.
     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
-    //~^ ERROR mismatched types
+    //~^ ERROR type mismatch
 }
 
 fn expect_bound_supply_free_from_closure() {
@@ -44,7 +44,7 @@ fn expect_bound_supply_free_from_closure() {
     // the argument level.
     type Foo<'a> = fn(&'a u32);
     with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
-    //~^ ERROR mismatched types
+    //~^ ERROR type mismatch
     });
 }
 
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
index b1cfd6cef10..ab35aeff697 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
@@ -36,33 +36,58 @@ note: ...does not necessarily outlive the anonymous lifetime #2 defined on the b
 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
    |                                                ^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:30:52
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/expect-fn-supply-fn.rs:30:5
    |
 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
-   |                                                    ^^^^^^^^ one type is more general than the other
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
+   |     |
+   |     expected signature of `fn(fn(&'a u32), &i32) -> _`
    |
-   = note: expected type `fn(&u32)`
-              found type `for<'r> fn(&'r u32)`
+note: required by `with_closure_expecting_fn_with_free_region`
+  --> $DIR/expect-fn-supply-fn.rs:1:1
+   |
+LL | / fn with_closure_expecting_fn_with_free_region<F>(_: F)
+LL | |     where F: for<'a> FnOnce(fn(&'a u32), &i32)
+LL | | {
+LL | | }
+   | |_^
 
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:37:53
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/expect-fn-supply-fn.rs:37:5
    |
 LL |     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
-   |                                                     ^^^^^^^^^^^ one type is more general than the other
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
+   |     |
+   |     expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
    |
-   = note: expected type `for<'r> fn(&'r u32)`
-              found type `fn(&'x u32)`
+note: required by `with_closure_expecting_fn_with_bound_region`
+  --> $DIR/expect-fn-supply-fn.rs:6:1
+   |
+LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F)
+LL | |     where F: FnOnce(fn(&u32), &i32)
+LL | | {
+LL | | }
+   | |_^
 
-error[E0308]: mismatched types
-  --> $DIR/expect-fn-supply-fn.rs:46:53
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/expect-fn-supply-fn.rs:46:5
    |
 LL |     with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
-   |                                                     ^^^^^^^ one type is more general than the other
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
+   |     |
+   |     expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
+   |
+note: required by `with_closure_expecting_fn_with_bound_region`
+  --> $DIR/expect-fn-supply-fn.rs:6:1
    |
-   = note: expected type `for<'r> fn(&'r u32)`
-              found type `fn(&u32)`
+LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F)
+LL | |     where F: FnOnce(fn(&u32), &i32)
+LL | | {
+LL | | }
+   | |_^
 
 error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
+Some errors occurred: E0308, E0631.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/coherence/coherence-subtyping.old.stderr b/src/test/ui/coherence/coherence-subtyping.old.stderr
deleted file mode 100644
index db9f9f76653..00000000000
--- a/src/test/ui/coherence/coherence-subtyping.old.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0119]: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
-  --> $DIR/coherence-subtyping.rs:15:1
-   |
-LL | impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
-   | --------------------------------------------------------- first implementation here
-...
-LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-   |
-   = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-subtyping.re.stderr b/src/test/ui/coherence/coherence-subtyping.re.stderr
deleted file mode 100644
index db9f9f76653..00000000000
--- a/src/test/ui/coherence/coherence-subtyping.re.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0119]: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
-  --> $DIR/coherence-subtyping.rs:15:1
-   |
-LL | impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
-   | --------------------------------------------------------- first implementation here
-...
-LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
-   |
-   = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-subtyping.rs b/src/test/ui/coherence/coherence-subtyping.rs
index f27e14eab63..e7406757806 100644
--- a/src/test/ui/coherence/coherence-subtyping.rs
+++ b/src/test/ui/coherence/coherence-subtyping.rs
@@ -1,7 +1,11 @@
 // Test that two distinct impls which match subtypes of one another
 // yield coherence errors (or not) depending on the variance.
+//
+// Note: This scenario is currently accepted, but as part of the
+// universe transition (#56105) may eventually become an error.
 
 // revisions: old re
+// compile-pass
 
 #![cfg_attr(re, feature(re_rebalance_coherence))]
 
@@ -13,8 +17,6 @@ impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
 }
 
 impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
-    //[old]~^ ERROR
-    //[re]~^^ ERROR
 }
 
 fn main() { }
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
index bdfabdabbeb..8e2b0b8c600 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hr-subtype.rs:39:26
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
 ...
 LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
 LL | |                                             for<'a>    fn(&'a u32, &'a u32) -> &'a u32) }
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr
index 25b74d855bb..dbb50181390 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr
@@ -1,14 +1,16 @@
-error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+error[E0308]: mismatched types
+  --> $DIR/hr-subtype.rs:39:26
    |
-LL | / fn main() {
-LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
-LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
-LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
-LL | | }
-   | |_^
+LL |               gimme::<$t1>(None::<$t2>);
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
+...
+LL | / check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32),
+LL | |                                 for<'a>    fn(&'a u32, &'a u32)) }
+   | |__________________________________________________________________- in this macro invocation
+   |
+   = note: expected type `std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32)>`
+              found type `std::option::Option<for<'a> fn(&'a u32, &'a u32)>`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr
index 25b74d855bb..5fcb63e17bf 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr
@@ -1,12 +1,12 @@
 error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+  --> $DIR/hr-subtype.rs:100:1
    |
 LL | / fn main() {
 LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
 LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
 LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
+LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
+LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
 LL | | }
    | |_^
 
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr
index 25b74d855bb..5fcb63e17bf 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr
@@ -1,12 +1,12 @@
 error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+  --> $DIR/hr-subtype.rs:100:1
    |
 LL | / fn main() {
 LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
 LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
 LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
+LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
+LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
 LL | | }
    | |_^
 
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
index 74b8c89b6e8..db9892b48a6 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hr-subtype.rs:39:26
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
 ...
 LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32),
 LL | |                              fn(&'x u32)) }
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr
index 25b74d855bb..e9fb73411bd 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr
@@ -1,14 +1,16 @@
-error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+error[E0308]: mismatched types
+  --> $DIR/hr-subtype.rs:39:26
    |
-LL | / fn main() {
-LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
-LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
-LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
-LL | | }
-   | |_^
+LL |               gimme::<$t1>(None::<$t2>);
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
+...
+LL | / check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>),
+LL | |                                       for<'a>    fn(Co<'a>, Co<'a>)) }
+   | |______________________________________________________________________- in this macro invocation
+   |
+   = note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>)>`
+              found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>)>`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr
index 25b74d855bb..d0e80faa68e 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr
@@ -1,14 +1,16 @@
-error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+error[E0308]: mismatched types
+  --> $DIR/hr-subtype.rs:39:26
    |
-LL | / fn main() {
-LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
-LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
-LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
-LL | | }
-   | |_^
+LL |               gimme::<$t1>(None::<$t2>);
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
+...
+LL | / check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>,
+LL | |                                         for<'a>    fn(Co<'a>, Co<'a>) -> Contra<'a>) }
+   | |______________________________________________________________________________________- in this macro invocation
+   |
+   = note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>) -> Contra<'a>>`
+              found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>>`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr
index 25b74d855bb..5fcb63e17bf 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr
@@ -1,12 +1,12 @@
 error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+  --> $DIR/hr-subtype.rs:100:1
    |
 LL | / fn main() {
 LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
 LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
 LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
+LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
+LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
 LL | | }
    | |_^
 
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr
index 25b74d855bb..3605ecf4f86 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr
@@ -1,14 +1,16 @@
-error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+error[E0308]: mismatched types
+  --> $DIR/hr-subtype.rs:39:26
    |
-LL | / fn main() {
-LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
-LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
-LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
-LL | | }
-   | |_^
+LL |               gimme::<$t1>(None::<$t2>);
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
+...
+LL | / check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>,
+LL | |                                             for<'a>    fn(Contra<'a>, Contra<'a>) -> Co<'a>) }
+   | |______________________________________________________________________________________________- in this macro invocation
+   |
+   = note: expected type `std::option::Option<for<'a, 'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>>`
+              found type `std::option::Option<for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>>`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
index 8168941e277..fae6e9b5c89 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hr-subtype.rs:39:26
    |
 LL |               gimme::<$t1>(None::<$t2>);
-   |                            ^^^^^^^^^^^ one type is more general than the other
+   |                            ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a
 ...
 LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
 LL | |                                         for<'a>    fn(Inv<'a>, Inv<'a>)) }
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr
index 25b74d855bb..5fcb63e17bf 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr
@@ -1,12 +1,12 @@
 error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+  --> $DIR/hr-subtype.rs:100:1
    |
 LL | / fn main() {
 LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
 LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
 LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
+LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
+LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
 LL | | }
    | |_^
 
diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr
index 25b74d855bb..5fcb63e17bf 100644
--- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr
@@ -1,12 +1,12 @@
 error: compilation successful
-  --> $DIR/hr-subtype.rs:96:1
+  --> $DIR/hr-subtype.rs:100:1
    |
 LL | / fn main() {
 LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
 LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
 LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
-...  |
-LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
+LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
+LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
 LL | | }
    | |_^
 
diff --git a/src/test/ui/hr-subtype/hr-subtype.rs b/src/test/ui/hr-subtype/hr-subtype.rs
index ad4f39f8405..2f7c1e6fd8c 100644
--- a/src/test/ui/hr-subtype/hr-subtype.rs
+++ b/src/test/ui/hr-subtype/hr-subtype.rs
@@ -42,6 +42,10 @@ macro_rules! check {
             //[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR
             //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^ ERROR
             //[free_inv_x_vs_free_inv_y]~^^^^^ ERROR
+            //[bound_a_b_vs_bound_a]~^^^^^^ ERROR mismatched types
+            //[bound_co_a_co_b_ret_contra_a]~^^^^^^^ ERROR
+            //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^ ERROR
+            //[bound_co_a_b_vs_bound_co_a]~^^^^^^^^^ ERROR
         }
     }
 }
@@ -99,8 +103,4 @@ fn main() {
 //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
 //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
 //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
-//[bound_a_b_vs_bound_a]~^^^^^^ ERROR compilation successful
-//[bound_co_a_co_b_ret_contra_a]~^^^^^^^ ERROR compilation successful
-//[bound_co_a_b_vs_bound_co_a]~^^^^^^^^ ERROR compilation successful
-//[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful
 }
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
index 630dda2694f..50e1af8f142 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.stderr
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
@@ -1,12 +1,20 @@
-error: implementation of `Foo` is not general enough
+error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied
   --> $DIR/hrtb-conflate-regions.rs:28:10
    |
 LL | fn b() { want_foo2::<SomeStruct>(); } //~ ERROR
-   |          ^^^^^^^^^^^^^^^^^^^^^^^
+   |          ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct`
    |
-   = note: Due to a where-clause on `want_foo2`,
-   = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
-   = note: but `SomeStruct` actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+   = help: the following implementations were found:
+             <SomeStruct as Foo<(&'a isize, &'a isize)>>
+note: required by `want_foo2`
+  --> $DIR/hrtb-conflate-regions.rs:8:1
+   |
+LL | / fn want_foo2<T>()
+LL | |     where T : for<'a,'b> Foo<(&'a isize, &'b isize)>
+LL | | {
+LL | | }
+   | |_^
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr b/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
index 6301ed45ac2..8e8892552b7 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hrtb-exists-forall-fn.rs:17:34
    |
 LL |     let _: for<'b> fn(&'b u32) = foo(); //~ ERROR mismatched types
-   |                                  ^^^^^ one type is more general than the other
+   |                                  ^^^^^ expected concrete lifetime, found bound lifetime parameter 'b
    |
    = note: expected type `for<'b> fn(&'b u32)`
               found type `fn(&u32)`
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
index 8801760056e..4c1d4d28a09 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
@@ -1,9 +1,7 @@
-// Test a `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
+// Test a case where variance and higher-ranked types interact in surprising ways.
 //
 // In particular, we test this pattern in trait solving, where it is not connected
 // to any part of the source code.
-//
-// compile-pass
 
 trait Trait<T> {}
 
@@ -30,6 +28,9 @@ fn main() {
     //     - `?a: ?b` -- solveable if `?b` is also inferred to `'empty`
     // - So the subtyping check succeeds, somewhat surprisingly.
     //   This is because we can use `'empty`.
+    //
+    // NB. *However*, the reinstated leak-check gives an error here.
 
     foo::<()>();
+    //~^ ERROR not satisfied
 }
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr
new file mode 100644
index 00000000000..7f2ca037f0f
--- /dev/null
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `(): Trait<for<'b> fn(&'b u32)>` is not satisfied
+  --> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
+   |
+LL |     foo::<()>();
+   |     ^^^^^^^^^ the trait `Trait<for<'b> fn(&'b u32)>` is not implemented for `()`
+   |
+   = help: the following implementations were found:
+             <() as Trait<fn(&'a u32)>>
+note: required by `foo`
+  --> $DIR/hrtb-exists-forall-trait-contravariant.rs:8:1
+   |
+LL | / fn foo<T>()
+LL | | where
+LL | |     T: Trait<for<'b> fn(&'b u32)>,
+LL | | {
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs
index da1bb7cd5fd..95b57d6c5bb 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs
@@ -1,9 +1,7 @@
-// Test a `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
+// Test a case where variance and higher-ranked types interact in surprising ways.
 //
 // In particular, we test this pattern in trait solving, where it is not connected
 // to any part of the source code.
-//
-// compile-pass
 
 trait Trait<T> {}
 
@@ -32,6 +30,9 @@ fn main() {
     //         - `?b: ?a` -- solveable if `?b` is inferred to `'static`
     // - So the subtyping check succeeds, somewhat surprisingly.
     //   This is because we can use `'static`.
+    //
+    // NB. *However*, the reinstated leak-check gives an error here.
 
     foo::<()>();
+    //~^ ERROR not satisfied
 }
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr
new file mode 100644
index 00000000000..cd5982e7588
--- /dev/null
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `(): Trait<for<'b> fn(fn(&'b u32))>` is not satisfied
+  --> $DIR/hrtb-exists-forall-trait-covariant.rs:36:5
+   |
+LL |     foo::<()>();
+   |     ^^^^^^^^^ the trait `Trait<for<'b> fn(fn(&'b u32))>` is not implemented for `()`
+   |
+   = help: the following implementations were found:
+             <() as Trait<fn(fn(&'a u32))>>
+note: required by `foo`
+  --> $DIR/hrtb-exists-forall-trait-covariant.rs:8:1
+   |
+LL | / fn foo<T>()
+LL | | where
+LL | |     T: Trait<for<'b> fn(fn(&'b u32))>,
+LL | | {
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
index da3f8ad1b89..827a68beee8 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
@@ -25,5 +25,5 @@ fn main() {
     //     yielding `fn(&!b u32)`, in a fresh universe U1
     //   - So we get `?a = !b` but the universe U0 assigned to `?a` cannot name `!b`.
 
-    foo::<()>(); //~ ERROR not general enough
+    foo::<()>(); //~ ERROR not satisfied
 }
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
index a44837a1e26..f56b81759fe 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
@@ -1,12 +1,21 @@
-error: implementation of `Trait` is not general enough
+error[E0277]: the trait bound `(): Trait<for<'b> fn(std::cell::Cell<&'b u32>)>` is not satisfied
   --> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
    |
-LL |     foo::<()>(); //~ ERROR not general enough
-   |     ^^^^^^^^^
+LL |     foo::<()>(); //~ ERROR not satisfied
+   |     ^^^^^^^^^ the trait `Trait<for<'b> fn(std::cell::Cell<&'b u32>)>` is not implemented for `()`
    |
-   = note: Due to a where-clause on `foo`,
-   = note: `()` must implement `Trait<for<'b> fn(std::cell::Cell<&'b u32>)>`
-   = note: but `()` actually implements `Trait<fn(std::cell::Cell<&'0 u32>)>`, for some specific lifetime `'0`
+   = help: the following implementations were found:
+             <() as Trait<fn(std::cell::Cell<&'a u32>)>>
+note: required by `foo`
+  --> $DIR/hrtb-exists-forall-trait-invariant.rs:10:1
+   |
+LL | / fn foo<T>()
+LL | | where
+LL | |     T: Trait<for<'b> fn(Cell<&'b u32>)>,
+LL | | {
+LL | | }
+   | |_^
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
index 0d7b5cbf823..77c1789852e 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
+++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
@@ -1,12 +1,19 @@
-error[E0308]: mismatched types
+error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
   --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:5
    |
 LL |     want_bar_for_any_ccx(b); //~ ERROR
-   |     ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+   |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
    |
-   = note: expected type `for<'ccx> Bar<'ccx>`
-              found type `Bar<'static>`
+   = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound
+note: required by `want_bar_for_any_ccx`
+  --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:31:1
+   |
+LL | / fn want_bar_for_any_ccx<B>(b: &B)
+LL | |     where B : for<'ccx> Bar<'ccx>
+LL | | {
+LL | | }
+   | |_^
 
 error: aborting due to 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/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs
index 3d2d403462d..48ebe5017aa 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs
+++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs
@@ -15,7 +15,7 @@ fn want_foo_for_some_tcx<'x,F>(f: &'x F)
     where F : Foo<'x>
 {
     want_foo_for_some_tcx(f);
-    want_foo_for_any_tcx(f); //~ ERROR E0308
+    want_foo_for_any_tcx(f); //~ ERROR not satisfied
 }
 
 fn want_foo_for_any_tcx<F>(f: &F)
@@ -32,7 +32,7 @@ fn want_bar_for_some_ccx<'x,B>(b: &B)
     want_foo_for_any_tcx(b);
 
     want_bar_for_some_ccx(b);
-    want_bar_for_any_ccx(b); //~ ERROR E0308
+    want_bar_for_any_ccx(b); //~ ERROR not satisfied
 }
 
 fn want_bar_for_any_ccx<B>(b: &B)
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
index 31dbeec2a55..5914cb3eaa4 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
+++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
@@ -1,21 +1,40 @@
-error[E0308]: mismatched types
+error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
   --> $DIR/hrtb-higher-ranker-supertraits.rs:18:5
    |
-LL |     want_foo_for_any_tcx(f); //~ ERROR E0308
-   |     ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+LL |     want_foo_for_any_tcx(f); //~ ERROR not satisfied
+   |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
    |
-   = note: expected type `for<'tcx> Foo<'tcx>`
-              found type `Foo<'x>`
+   = help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound
+note: required by `want_foo_for_any_tcx`
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:21:1
+   |
+LL | / fn want_foo_for_any_tcx<F>(f: &F)
+LL | |     where F : for<'tcx> Foo<'tcx>
+LL | | {
+LL | |     want_foo_for_some_tcx(f);
+LL | |     want_foo_for_any_tcx(f);
+LL | | }
+   | |_^
 
-error[E0308]: mismatched types
+error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
   --> $DIR/hrtb-higher-ranker-supertraits.rs:35:5
    |
-LL |     want_bar_for_any_ccx(b); //~ ERROR E0308
-   |     ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+LL |     want_bar_for_any_ccx(b); //~ ERROR not satisfied
+   |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
+   |
+   = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound
+note: required by `want_bar_for_any_ccx`
+  --> $DIR/hrtb-higher-ranker-supertraits.rs:38:1
    |
-   = note: expected type `for<'ccx> Bar<'ccx>`
-              found type `Bar<'x>`
+LL | / fn want_bar_for_any_ccx<B>(b: &B)
+LL | |     where B : for<'ccx> Bar<'ccx>
+LL | | {
+LL | |     want_foo_for_some_tcx(b);
+...  |
+LL | |     want_bar_for_any_ccx(b);
+LL | | }
+   | |_^
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr
index 99c87f13672..fe2bc1f2225 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.stderr
+++ b/src/test/ui/hrtb/hrtb-just-for-static.stderr
@@ -1,22 +1,37 @@
-error: implementation of `Foo` is not general enough
+error[E0277]: the trait bound `for<'a> StaticInt: Foo<&'a isize>` is not satisfied
   --> $DIR/hrtb-just-for-static.rs:24:5
    |
 LL |     want_hrtb::<StaticInt>() //~ ERROR
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt`
    |
-   = note: Due to a where-clause on `want_hrtb`,
-   = note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`
-   = note: but `StaticInt` actually implements `Foo<&'1 isize>`, for some specific lifetime `'1`
+   = help: the following implementations were found:
+             <StaticInt as Foo<&'static isize>>
+note: required by `want_hrtb`
+  --> $DIR/hrtb-just-for-static.rs:8:1
+   |
+LL | / fn want_hrtb<T>()
+LL | |     where T : for<'a> Foo<&'a isize>
+LL | | {
+LL | | }
+   | |_^
 
-error: implementation of `Foo` is not general enough
+error[E0277]: the trait bound `for<'a> &'a u32: Foo<&'a isize>` is not satisfied
   --> $DIR/hrtb-just-for-static.rs:30:5
    |
 LL |     want_hrtb::<&'a u32>() //~ ERROR
-   |     ^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `&'a u32`
+   |
+   = help: the following implementations were found:
+             <&'a u32 as Foo<&'a isize>>
+note: required by `want_hrtb`
+  --> $DIR/hrtb-just-for-static.rs:8:1
    |
-   = note: Due to a where-clause on `want_hrtb`,
-   = note: `Foo<&'0 isize>` would have to be implemented for the type `&'a u32`, for any lifetime `'0`
-   = note: but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
+LL | / fn want_hrtb<T>()
+LL | |     where T : for<'a> Foo<&'a isize>
+LL | | {
+LL | | }
+   | |_^
 
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/issue-46989.rs b/src/test/ui/hrtb/issue-46989.rs
new file mode 100644
index 00000000000..2c859055458
--- /dev/null
+++ b/src/test/ui/hrtb/issue-46989.rs
@@ -0,0 +1,42 @@
+// Regression test for #46989:
+//
+// In the move to universes, this test started passing.
+// It is not necessarily WRONG to do so, but it was a bit
+// surprising. The reason that it passed is that when we were
+// asked to prove that
+//
+//     for<'a> fn(&'a i32): Foo
+//
+// we were able to use the impl below to prove
+//
+//     fn(&'empty i32): Foo
+//
+// and then we were able to prove that
+//
+//     fn(&'empty i32) = for<'a> fn(&'a i32)
+//
+// This last fact is somewhat surprising, but essentially "falls out"
+// from handling variance correctly. In particular, consider the subtyping
+// relations. First:
+//
+//     fn(&'empty i32) <: for<'a> fn(&'a i32)
+//
+// This holds because -- intuitively -- a fn that takes a reference but doesn't use
+// it can be given a reference with any lifetime. Similarly, the opposite direction:
+//
+//     for<'a> fn(&'a i32) <: fn(&'empty i32)
+//
+// holds because 'a can be instantiated to 'empty.
+
+trait Foo {
+
+}
+
+impl<A> Foo for fn(A) { }
+
+fn assert_foo<T: Foo>() {}
+
+fn main() {
+    assert_foo::<fn(&i32)>();
+    //~^ ERROR the trait bound `for<'r> fn(&'r i32): Foo` is not satisfied
+}
diff --git a/src/test/ui/hrtb/issue-46989.stderr b/src/test/ui/hrtb/issue-46989.stderr
new file mode 100644
index 00000000000..b308291d5c0
--- /dev/null
+++ b/src/test/ui/hrtb/issue-46989.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `for<'r> fn(&'r i32): Foo` is not satisfied
+  --> $DIR/issue-46989.rs:40:5
+   |
+LL |     assert_foo::<fn(&i32)>();
+   |     ^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `for<'r> fn(&'r i32)`
+   |
+   = help: the following implementations were found:
+             <fn(A) as Foo>
+note: required by `assert_foo`
+  --> $DIR/issue-46989.rs:37:1
+   |
+LL | fn assert_foo<T: Foo>() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/hrtb/issue-57639.rs b/src/test/ui/hrtb/issue-57639.rs
new file mode 100644
index 00000000000..4bcaef3616b
--- /dev/null
+++ b/src/test/ui/hrtb/issue-57639.rs
@@ -0,0 +1,29 @@
+// Regression test for #57639:
+//
+// In the move to universes, this test stopped working. The problem
+// was that when the trait solver was asked to prove `for<'a> T::Item:
+// Foo<'a>` as part of WF checking, it wound up "eagerly committing"
+// to the where clause, which says that `T::Item: Foo<'a>`, but it
+// should instead have been using the bound found in the trait
+// declaration. Pre-universe, this used to work out ok because we got
+// "eager errors" due to the leak check.
+//
+// See [this comment on GitHub][c] for more details.
+//
+// run-pass
+//
+// [c]: https://github.com/rust-lang/rust/issues/57639#issuecomment-455685861
+
+trait Foo<'a> {}
+
+trait Bar {
+    type Item: for<'a> Foo<'a>;
+}
+
+fn foo<'a, T>(_: T)
+where
+    T: Bar,
+    T::Item: Foo<'a>,
+{}
+
+fn main() { }
diff --git a/src/test/ui/hrtb/issue-58451.rs b/src/test/ui/hrtb/issue-58451.rs
new file mode 100644
index 00000000000..229e5057678
--- /dev/null
+++ b/src/test/ui/hrtb/issue-58451.rs
@@ -0,0 +1,13 @@
+// Regression test for #58451:
+//
+// Error reporting here encountered an ICE in the shift to universes.
+
+fn f<I>(i: I)
+where
+    I: IntoIterator,
+    I::Item: for<'a> Into<&'a ()>,
+{}
+
+fn main() {
+    f(&[f()]); //~ ERROR this function takes 1 parameter
+}
diff --git a/src/test/ui/hrtb/issue-58451.stderr b/src/test/ui/hrtb/issue-58451.stderr
new file mode 100644
index 00000000000..79c24855dc9
--- /dev/null
+++ b/src/test/ui/hrtb/issue-58451.stderr
@@ -0,0 +1,16 @@
+error[E0061]: this function takes 1 parameter but 0 parameters were supplied
+  --> $DIR/issue-58451.rs:12:9
+   |
+LL | / fn f<I>(i: I)
+LL | | where
+LL | |     I: IntoIterator,
+LL | |     I::Item: for<'a> Into<&'a ()>,
+LL | | {}
+   | |__- defined here
+...
+LL |       f(&[f()]); //~ ERROR this function takes 1 parameter
+   |           ^^^ expected 1 parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/issues/issue-40000.stderr b/src/test/ui/issues/issue-40000.stderr
index d7966cea52b..ce0c44c1475 100644
--- a/src/test/ui/issues/issue-40000.stderr
+++ b/src/test/ui/issues/issue-40000.stderr
@@ -2,10 +2,10 @@ error[E0308]: mismatched types
   --> $DIR/issue-40000.rs:6:9
    |
 LL |     foo(bar); //~ ERROR E0308
-   |         ^^^ one type is more general than the other
+   |         ^^^ expected concrete lifetime, found bound lifetime parameter
    |
-   = note: expected type `dyn for<'r> std::ops::Fn(&'r i32)`
-              found type `dyn std::ops::Fn(&i32)`
+   = note: expected type `std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r i32) + 'static)>`
+              found type `std::boxed::Box<dyn std::ops::Fn(_)>`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-57362-1.rs b/src/test/ui/issues/issue-57362-1.rs
index fe6b69f0097..1fa417fe98a 100644
--- a/src/test/ui/issues/issue-57362-1.rs
+++ b/src/test/ui/issues/issue-57362-1.rs
@@ -17,7 +17,7 @@ impl<T> Trait for fn(&T) {
 
 fn f() {
     let a: fn(_) = |_: &u8| {};
-    a.f(); //~ ERROR not general enough
+    a.f(); //~ ERROR no method named `f`
 }
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-57362-1.stderr b/src/test/ui/issues/issue-57362-1.stderr
index 06946bcf744..b21b35849b1 100644
--- a/src/test/ui/issues/issue-57362-1.stderr
+++ b/src/test/ui/issues/issue-57362-1.stderr
@@ -1,11 +1,14 @@
-error: implementation of `Trait` is not general enough
+error[E0599]: no method named `f` found for type `fn(&u8)` in the current scope
   --> $DIR/issue-57362-1.rs:20:7
    |
-LL |     a.f(); //~ ERROR not general enough
+LL |     a.f(); //~ ERROR no method named `f`
    |       ^
    |
-   = note: `Trait` would have to be implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0`
-   = note: but `Trait` is actually implemented for the type `for<'r> fn(&'r u8)`
+   = note: a is a function, perhaps you wish to call it
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `f`, perhaps you need to implement it:
+           candidate #1: `Trait`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/issues/issue-57362-2.rs b/src/test/ui/issues/issue-57362-2.rs
index 436a4a90457..870d7f28ba9 100644
--- a/src/test/ui/issues/issue-57362-2.rs
+++ b/src/test/ui/issues/issue-57362-2.rs
@@ -19,7 +19,7 @@ impl<'a> X for fn(&'a ()) {
 }
 
 fn g() {
-    let x = <fn (&())>::make_g(); //~ ERROR not general enough
+    let x = <fn (&())>::make_g(); //~ ERROR no function or associated item
 }
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-57362-2.stderr b/src/test/ui/issues/issue-57362-2.stderr
index 14b7f52bb87..b8211691f7b 100644
--- a/src/test/ui/issues/issue-57362-2.stderr
+++ b/src/test/ui/issues/issue-57362-2.stderr
@@ -1,11 +1,15 @@
-error: implementation of `X` is not general enough
-  --> $DIR/issue-57362-2.rs:22:13
+error[E0599]: no function or associated item named `make_g` found for type `for<'r> fn(&'r ())` in the current scope
+  --> $DIR/issue-57362-2.rs:22:25
    |
-LL |     let x = <fn (&())>::make_g(); //~ ERROR not general enough
-   |             ^^^^^^^^^^^^^^^^^^
+LL |     let x = <fn (&())>::make_g(); //~ ERROR no function or associated item
+   |             ------------^^^^^^
+   |             |
+   |             function or associated item not found in `for<'r> fn(&'r ())`
    |
-   = note: `X` would have to be implemented for the type `for<'r> fn(&'r ())`
-   = note: but `X` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `make_g`, perhaps you need to implement it:
+           candidate #1: `X`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr.rs b/src/test/ui/lub-glb/old-lub-glb-hr.rs
index 324dc86bd92..6bf1fd41d77 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-hr.rs
@@ -4,7 +4,8 @@
 // longer get an error, because we recognize these two types as
 // equivalent!
 //
-// compile-pass
+// Whoops -- now that we reinstituted the leak-check, we get an error
+// again.
 
 fn foo(
     x: fn(&u8, &u8),
@@ -12,7 +13,7 @@ fn foo(
 ) {
     let z = match 22 {
         0 => x,
-        _ => y,
+        _ => y, //~ ERROR match arms have incompatible types
     };
 }
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr.stderr b/src/test/ui/lub-glb/old-lub-glb-hr.stderr
new file mode 100644
index 00000000000..8f228ea4cad
--- /dev/null
+++ b/src/test/ui/lub-glb/old-lub-glb-hr.stderr
@@ -0,0 +1,18 @@
+error[E0308]: match arms have incompatible types
+  --> $DIR/old-lub-glb-hr.rs:16:14
+   |
+LL |       let z = match 22 {
+   |  _____________-
+LL | |         0 => x,
+   | |              - this is found to be of type `for<'r, 's> fn(&'r u8, &'s u8)`
+LL | |         _ => y, //~ ERROR match arms have incompatible types
+   | |              ^ expected bound lifetime parameter, found concrete lifetime
+LL | |     };
+   | |_____- `match` arms have incompatible types
+   |
+   = note: expected type `for<'r, 's> fn(&'r u8, &'s u8)`
+              found type `for<'a> fn(&'a u8, &'a u8)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.rs b/src/test/ui/lub-glb/old-lub-glb-object.rs
index 9be7a813603..dcd604a5157 100644
--- a/src/test/ui/lub-glb/old-lub-glb-object.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-object.rs
@@ -7,9 +7,9 @@ fn foo(
     x: &for<'a, 'b> Foo<&'a u8, &'b u8>,
     y: &for<'a> Foo<&'a u8, &'a u8>,
 ) {
-    let z = match 22 { //~ ERROR E0308
+    let z = match 22 {
         0 => x,
-        _ => y,
+        _ => y, //~ ERROR match arms have incompatible types
     };
 }
 
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr
index 17d3648156b..056f9131dd2 100644
--- a/src/test/ui/lub-glb/old-lub-glb-object.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr
@@ -1,15 +1,17 @@
-error[E0308]: mismatched types
-  --> $DIR/old-lub-glb-object.rs:10:13
+error[E0308]: match arms have incompatible types
+  --> $DIR/old-lub-glb-object.rs:12:14
    |
-LL |       let z = match 22 { //~ ERROR E0308
-   |  _____________^
+LL |       let z = match 22 {
+   |  _____________-
 LL | |         0 => x,
-LL | |         _ => y,
+   | |              - this is found to be of type `&dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
+LL | |         _ => y, //~ ERROR match arms have incompatible types
+   | |              ^ expected bound lifetime parameter 'a, found concrete lifetime
 LL | |     };
-   | |_____^ one type is more general than the other
+   | |_____- `match` arms have incompatible types
    |
-   = note: expected type `dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
-              found type `dyn for<'a> Foo<&'a u8, &'a u8>`
+   = note: expected type `&dyn for<'a, 'b> Foo<&'a u8, &'b u8>`
+              found type `&dyn for<'a> Foo<&'a u8, &'a u8>`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
index 437150666be..521bd3695df 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
@@ -7,6 +7,6 @@ fn main() {
 
 fn baz<F: Fn(*mut &u32)>(_: F) {}
 fn _test<'a>(f: fn(*mut &'a u32)) {
-    baz(f); //~ ERROR mismatched types
-     //~| ERROR mismatched types
+    baz(f); //~ ERROR type mismatch
+     //~| ERROR type mismatch
 }
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
index a6628006587..5dd6887005e 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
@@ -22,25 +22,34 @@ LL |     a.iter().map(|_: (u16, u16)| 45); //~ ERROR type mismatch
    |              |
    |              expected signature of `fn(&(u32, u32)) -> _`
 
-error[E0308]: mismatched types
+error[E0631]: type mismatch in function arguments
   --> $DIR/closure-arg-type-mismatch.rs:10:5
    |
-LL |     baz(f); //~ ERROR mismatched types
-   |     ^^^ one type is more general than the other
+LL |     baz(f); //~ ERROR type mismatch
+   |     ^^^
+   |     |
+   |     expected signature of `for<'r> fn(*mut &'r u32) -> _`
+   |     found signature of `fn(*mut &'a u32) -> _`
    |
-   = note: expected type `for<'r> std::ops::Fn<(*mut &'r u32,)>`
-              found type `std::ops::Fn<(*mut &'a u32,)>`
+note: required by `baz`
+  --> $DIR/closure-arg-type-mismatch.rs:8:1
+   |
+LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0308]: mismatched types
+error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::FnOnce<(*mut &'r u32,)>>::Output == ()`
   --> $DIR/closure-arg-type-mismatch.rs:10:5
    |
-LL |     baz(f); //~ ERROR mismatched types
-   |     ^^^ one type is more general than the other
+LL |     baz(f); //~ ERROR type mismatch
+   |     ^^^ expected bound lifetime parameter, found concrete lifetime
+   |
+note: required by `baz`
+  --> $DIR/closure-arg-type-mismatch.rs:8:1
    |
-   = note: expected type `std::ops::FnOnce<(*mut &u32,)>`
-              found type `std::ops::FnOnce<(*mut &'a u32,)>`
+LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 5 previous errors
 
-Some errors occurred: E0308, E0631.
-For more information about an error, try `rustc --explain E0308`.
+Some errors occurred: E0271, E0631.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/src/test/ui/mismatched_types/closure-mismatch.rs b/src/test/ui/mismatched_types/closure-mismatch.rs
index 152a5254937..40a4641fe71 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.rs
+++ b/src/test/ui/mismatched_types/closure-mismatch.rs
@@ -5,5 +5,6 @@ impl<T: Fn(&())> Foo for T {}
 fn baz<T: Foo>(_: T) {}
 
 fn main() {
-    baz(|_| ()); //~ ERROR E0308
+    baz(|_| ()); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
 }
diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr
index 0d87bc22875..e55047e96c2 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.stderr
+++ b/src/test/ui/mismatched_types/closure-mismatch.stderr
@@ -1,12 +1,32 @@
-error[E0308]: mismatched types
+error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.rs:8:9: 8:15] as std::ops::FnOnce<(&'r (),)>>::Output == ()`
   --> $DIR/closure-mismatch.rs:8:5
    |
-LL |     baz(|_| ()); //~ ERROR E0308
-   |     ^^^ one type is more general than the other
+LL |     baz(|_| ()); //~ ERROR type mismatch
+   |     ^^^ expected bound lifetime parameter, found concrete lifetime
    |
-   = note: expected type `for<'r> std::ops::Fn<(&'r (),)>`
-              found type `std::ops::Fn<(&(),)>`
+   = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:8:9: 8:15]`
+note: required by `baz`
+  --> $DIR/closure-mismatch.rs:5:1
+   |
+LL | fn baz<T: Foo>(_: T) {}
+   | ^^^^^^^^^^^^^^^^^^^^
+
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/closure-mismatch.rs:8:5
+   |
+LL |     baz(|_| ()); //~ ERROR type mismatch
+   |     ^^^ ------ found signature of `fn(_) -> _`
+   |     |
+   |     expected signature of `for<'r> fn(&'r ()) -> _`
+   |
+   = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:8:9: 8:15]`
+note: required by `baz`
+  --> $DIR/closure-mismatch.rs:5:1
+   |
+LL | fn baz<T: Foo>(_: T) {}
+   | ^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
+Some errors occurred: E0271, E0631.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/src/test/ui/mismatched_types/issue-36053-2.rs b/src/test/ui/mismatched_types/issue-36053-2.rs
index 9035e3380b0..9edfebcd494 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.rs
+++ b/src/test/ui/mismatched_types/issue-36053-2.rs
@@ -7,4 +7,5 @@ fn main() {
     once::<&str>("str").fuse().filter(|a: &str| true).count();
     //~^ ERROR no method named `count`
     //~| ERROR type mismatch in closure arguments
+    //~| ERROR type mismatch in closure arguments
 }
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index e53e8c520e0..c5c67e6bd9b 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -16,7 +16,15 @@ LL |     once::<&str>("str").fuse().filter(|a: &str| true).count();
    |                                |
    |                                expected signature of `for<'r> fn(&'r &str) -> _`
 
-error: aborting due to 2 previous errors
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/issue-36053-2.rs:7:32
+   |
+LL |     once::<&str>("str").fuse().filter(|a: &str| true).count();
+   |                                ^^^^^^ -------------- found signature of `for<'r> fn(&'r str) -> _`
+   |                                |
+   |                                expected signature of `fn(&&str) -> _`
+
+error: aborting due to 3 previous errors
 
 Some errors occurred: E0599, E0631.
 For more information about an error, try `rustc --explain E0599`.
diff --git a/src/test/ui/regions-fn-subtyping-return-static-fail.rs b/src/test/ui/regions-fn-subtyping-return-static-fail.rs
index 242119cc201..2dd0c9796e2 100644
--- a/src/test/ui/regions-fn-subtyping-return-static-fail.rs
+++ b/src/test/ui/regions-fn-subtyping-return-static-fail.rs
@@ -37,7 +37,7 @@ fn baz(x: &S) -> &S {
 fn supply_F() {
     want_F(foo);
 
-    want_F(bar);
+    want_F(bar); //~ ERROR mismatched types
 
     want_F(baz);
 }
@@ -45,7 +45,7 @@ fn supply_F() {
 fn supply_G() {
     want_G(foo);
     want_G(bar);
-    want_G(baz); //~ ERROR
+    want_G(baz); //~ ERROR mismatched types
 }
 
 pub fn main() {
diff --git a/src/test/ui/regions-fn-subtyping-return-static-fail.stderr b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr
index a9234e43191..66e6a615b33 100644
--- a/src/test/ui/regions-fn-subtyping-return-static-fail.stderr
+++ b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr
@@ -1,12 +1,21 @@
 error[E0308]: mismatched types
+  --> $DIR/regions-fn-subtyping-return-static-fail.rs:40:12
+   |
+LL |     want_F(bar); //~ ERROR mismatched types
+   |            ^^^ expected concrete lifetime, found bound lifetime parameter 'cx
+   |
+   = note: expected type `for<'cx> fn(&'cx S) -> &'cx S`
+              found type `for<'a> fn(&'a S) -> &S {bar::<'_>}`
+
+error[E0308]: mismatched types
   --> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12
    |
-LL |     want_G(baz); //~ ERROR
-   |            ^^^ one type is more general than the other
+LL |     want_G(baz); //~ ERROR mismatched types
+   |            ^^^ expected concrete lifetime, found bound lifetime parameter 'cx
    |
    = note: expected type `for<'cx> fn(&'cx S) -> &'static S`
-              found type `for<'r> fn(&'r S) -> &'r S`
+              found type `for<'r> fn(&'r S) -> &'r S {baz}`
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
index 47e1d0efdc7..5c8b3d3ba69 100644
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
+++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
@@ -20,10 +20,10 @@ error[E0308]: mismatched types
   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR mismatched types
-   |                                           ^ one type is more general than the other
+   |                                           ^ expected concrete lifetime, found bound lifetime parameter
    |
    = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
-              found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
+              found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
index 1e7b99053f7..f36885f7aeb 100644
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
@@ -31,10 +31,10 @@ error[E0308]: mismatched types
   --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
    |
 LL |     let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; //~ ERROR E0308
-   |                                                        ^ one type is more general than the other
+   |                                                        ^ expected concrete lifetime, found bound lifetime parameter
    |
    = note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
-              found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize)`
+              found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static.rs b/src/test/ui/regions/regions-fn-subtyping-return-static.rs
index 9010770f1dc..fa2cc37d05b 100644
--- a/src/test/ui/regions/regions-fn-subtyping-return-static.rs
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static.rs
@@ -5,8 +5,6 @@
 // *ANY* lifetime and returns a reference with the 'static lifetime.
 // This can safely be considered to be an instance of `F` because all
 // lifetimes are sublifetimes of 'static.
-//
-// compile-pass
 
 #![allow(dead_code)]
 #![allow(unused_variables)]
@@ -40,7 +38,7 @@ fn baz(x: &S) -> &S {
 fn supply_F() {
     want_F(foo);
 
-    want_F(bar);
+    want_F(bar); //~ ERROR mismatched types
 
     want_F(baz);
 }
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static.stderr
new file mode 100644
index 00000000000..42a5a7c806e
--- /dev/null
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+  --> $DIR/regions-fn-subtyping-return-static.rs:41:12
+   |
+LL |     want_F(bar); //~ ERROR mismatched types
+   |            ^^^ expected concrete lifetime, found bound lifetime parameter 'cx
+   |
+   = note: expected type `for<'cx> fn(&'cx S) -> &'cx S`
+              found type `for<'a> fn(&'a S) -> &S {bar::<'_>}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
index a43ee7ec3ac..99d85e9e4b5 100644
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
+++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
@@ -20,10 +20,10 @@ error[E0308]: mismatched types
   --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR E0308
-   |                                           ^ one type is more general than the other
+   |                                           ^ expected concrete lifetime, found bound lifetime parameter
    |
    = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
-              found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
+              found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs
index 12626fe69cb..a6e26614a6a 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs
+++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs
@@ -11,11 +11,13 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 fn a() {
     let x = call_it(&square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn c() {
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
index 29f276711c7..ca029828366 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
@@ -11,8 +11,21 @@ note: required by `call_it`
 LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:13
+   |
+LL |     let x = call_it(&square, 22);
+   |             ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+note: required by `call_it`
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:7:1
+   |
+LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
-  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:17:13
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:13
    |
 LL |     let y = call_it_mut(&mut square, 22);
    |             ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
@@ -25,18 +38,31 @@ LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
-  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:22:13
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:13
+   |
+LL |     let y = call_it_mut(&mut square, 22);
+   |             ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+note: required by `call_it_mut`
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:8:1
+   |
+LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+  --> $DIR/unboxed-closures-unsafe-extern-fn.rs:24:13
    |
 LL |     let z = call_it_once(square, 22);
    |             ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
    |
-   = help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
 note: required by `call_it_once`
   --> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:1
    |
 LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs
index 7c3152c87c4..dd3b1afc39f 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs
@@ -11,11 +11,13 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 fn a() {
     let x = call_it(&square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn c() {
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
index e3824578605..0abc58aeebf 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
@@ -11,8 +11,21 @@ note: required by `call_it`
 LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+  --> $DIR/unboxed-closures-wrong-abi.rs:12:13
+   |
+LL |     let x = call_it(&square, 22);
+   |             ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+note: required by `call_it`
+  --> $DIR/unboxed-closures-wrong-abi.rs:7:1
+   |
+LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
-  --> $DIR/unboxed-closures-wrong-abi.rs:17:13
+  --> $DIR/unboxed-closures-wrong-abi.rs:18:13
    |
 LL |     let y = call_it_mut(&mut square, 22);
    |             ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
@@ -25,18 +38,31 @@ LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
-  --> $DIR/unboxed-closures-wrong-abi.rs:22:13
+  --> $DIR/unboxed-closures-wrong-abi.rs:18:13
+   |
+LL |     let y = call_it_mut(&mut square, 22);
+   |             ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+note: required by `call_it_mut`
+  --> $DIR/unboxed-closures-wrong-abi.rs:8:1
+   |
+LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+  --> $DIR/unboxed-closures-wrong-abi.rs:24:13
    |
 LL |     let z = call_it_once(square, 22);
    |             ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
    |
-   = help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
 note: required by `call_it_once`
   --> $DIR/unboxed-closures-wrong-abi.rs:9:1
    |
 LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs
index 61d46869cbb..c689d792661 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs
@@ -12,11 +12,13 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 fn a() {
     let x = call_it(&square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
     //~^ ERROR E0277
+    //~| ERROR expected
 }
 
 fn c() {
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
index da511f091bf..19b87ad171a 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
@@ -11,8 +11,21 @@ note: required by `call_it`
 LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:13
+   |
+LL |     let x = call_it(&square, 22);
+   |             ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+note: required by `call_it`
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:8:1
+   |
+LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
-  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:18:13
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:13
    |
 LL |     let y = call_it_mut(&mut square, 22);
    |             ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
@@ -25,18 +38,31 @@ LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
-  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:23:13
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:13
+   |
+LL |     let y = call_it_mut(&mut square, 22);
+   |             ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
+   |
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+note: required by `call_it_mut`
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:9:1
+   |
+LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
+  --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:25:13
    |
 LL |     let z = call_it_once(square, 22);
    |             ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
    |
-   = help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+   = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
 note: required by `call_it_once`
   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:1
    |
 LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/where-clauses/where-for-self-2.rs b/src/test/ui/where-clauses/where-for-self-2.rs
index 0ce38e69f6b..31174fd4cf1 100644
--- a/src/test/ui/where-clauses/where-for-self-2.rs
+++ b/src/test/ui/where-clauses/where-for-self-2.rs
@@ -18,5 +18,5 @@ fn foo<T>(x: &T)
 {}
 
 fn main() {
-    foo(&X); //~ ERROR implementation of `Bar` is not general enough
+    foo(&X); //~ ERROR trait bound
 }
diff --git a/src/test/ui/where-clauses/where-for-self-2.stderr b/src/test/ui/where-clauses/where-for-self-2.stderr
index 342cabfd6bf..bbcb61a856d 100644
--- a/src/test/ui/where-clauses/where-for-self-2.stderr
+++ b/src/test/ui/where-clauses/where-for-self-2.stderr
@@ -1,12 +1,19 @@
-error: implementation of `Bar` is not general enough
+error[E0277]: the trait bound `for<'a> &'a _: Bar` is not satisfied
   --> $DIR/where-for-self-2.rs:21:5
    |
-LL |     foo(&X); //~ ERROR implementation of `Bar` is not general enough
-   |     ^^^
+LL |     foo(&X); //~ ERROR trait bound
+   |     ^^^ the trait `for<'a> Bar` is not implemented for `&'a _`
    |
-   = note: Due to a where-clause on `foo`,
-   = note: `Bar` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`
-   = note: but `Bar` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
+   = help: the following implementations were found:
+             <&'static u32 as Bar>
+note: required by `foo`
+  --> $DIR/where-for-self-2.rs:16:1
+   |
+LL | / fn foo<T>(x: &T)
+LL | |     where for<'a> &'a T: Bar
+LL | | {}
+   | |__^
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0277`.