about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-06 19:15:05 +0000
committerbors <bors@rust-lang.org>2018-08-06 19:15:05 +0000
commitcf84056149baf649f0c297b02afdde7db2187f46 (patch)
treef322017d69515a84110330ad5f47e59bb902bcc9
parentb2397437530eecef72a1524a7e0a4b42034fa360 (diff)
parent37ba9ca3343f6b51f1c1db1c8d9ad72aa5287a9b (diff)
downloadrust-cf84056149baf649f0c297b02afdde7db2187f46.tar.gz
rust-cf84056149baf649f0c297b02afdde7db2187f46.zip
Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis
Disable some nice region errors in NLL mode.

Fixes #52739. cc #52742.

r? @nikomatsakis
-rw-r--r--src/librustc/infer/error_reporting/nice_region_error/mod.rs6
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs2
-rw-r--r--src/test/compile-fail/nll/where_clauses_in_functions.rs2
-rw-r--r--src/test/compile-fail/nll/where_clauses_in_structs.rs2
-rw-r--r--src/test/ui/in-band-lifetimes/mismatched.nll.stderr12
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr17
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr11
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr17
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr9
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr17
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr9
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr35
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-val.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr35
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr11
-rw-r--r--src/test/ui/nll/issue-52113.rs2
-rw-r--r--src/test/ui/nll/issue-52113.stderr11
39 files changed, 205 insertions, 187 deletions
diff --git a/src/librustc/infer/error_reporting/nice_region_error/mod.rs b/src/librustc/infer/error_reporting/nice_region_error/mod.rs
index f50c23b0aa7..ddeb291a13a 100644
--- a/src/librustc/infer/error_reporting/nice_region_error/mod.rs
+++ b/src/librustc/infer/error_reporting/nice_region_error/mod.rs
@@ -64,6 +64,12 @@ impl<'cx, 'gcx, 'tcx> NiceRegionError<'cx, 'gcx, 'tcx> {
         Self { tcx, error: None, regions: Some((span, sub, sup)), tables }
     }
 
+    pub fn try_report_from_nll(&self) -> Option<ErrorReported> {
+        // Due to the improved diagnostics returned by the MIR borrow checker, only a subset of
+        // the nice region errors are required when running under the MIR borrow checker.
+        self.try_report_named_anon_conflict()
+    }
+
     pub fn try_report(&self) -> Option<ErrorReported> {
         self.try_report_named_anon_conflict()
             .or_else(|| self.try_report_anon_anon_conflict())
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
index 8fbb4aafc1f..c2670389e2d 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
@@ -310,7 +310,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
         if let (Some(f), Some(o)) = (self.to_error_region(fr), self.to_error_region(outlived_fr)) {
             let tables = infcx.tcx.typeck_tables_of(mir_def_id);
             let nice = NiceRegionError::new_from_span(infcx.tcx, span, o, f, Some(tables));
-            if let Some(_error_reported) = nice.try_report() {
+            if let Some(_error_reported) = nice.try_report_from_nll() {
                 return;
             }
         }
diff --git a/src/test/compile-fail/nll/where_clauses_in_functions.rs b/src/test/compile-fail/nll/where_clauses_in_functions.rs
index 1a3dc76005d..0efdd19df3c 100644
--- a/src/test/compile-fail/nll/where_clauses_in_functions.rs
+++ b/src/test/compile-fail/nll/where_clauses_in_functions.rs
@@ -21,7 +21,7 @@ where
 
 fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
     foo(x, y)
-    //~^ ERROR lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
diff --git a/src/test/compile-fail/nll/where_clauses_in_structs.rs b/src/test/compile-fail/nll/where_clauses_in_structs.rs
index 69f0f43af13..92e7db86173 100644
--- a/src/test/compile-fail/nll/where_clauses_in_structs.rs
+++ b/src/test/compile-fail/nll/where_clauses_in_structs.rs
@@ -21,7 +21,7 @@ struct Foo<'a: 'b, 'b> {
 
 fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
     Foo { x, y };
-    //~^ ERROR lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
diff --git a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
index cd2ebc341ea..c923e6610ce 100644
--- a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
@@ -18,15 +18,15 @@ LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime re
    |                    |
    |                    consider changing the type of `y` to `&'a u32`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/mismatched.rs:16:46
    |
 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
-   |                        -------     -------   ^ ...but data from `y` is returned here
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |             --          --                   ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |             |           |
+   |             |           lifetime `'b` defined here
+   |             lifetime `'a` defined here
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0621, E0623.
-For more information about an error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
index 71e9c34ac2b..b6bf646132e 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
    |                    ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:12
    |
 LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |                   ----                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |            --     - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
-   |            ^^^^^ ...but data from `x` is returned here
+   |            ^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
index 6c16d6a608e..93eac05e8d2 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
    |
 LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
-   |                        -------     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |          --  - let's call the lifetime of this reference `'1`
+   |          |
+   |          lifetime `'a` defined here
 LL | 
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
index 6dc96ace4d0..c5b4fd1934b 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                              ^^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:9
    |
 LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
-   |                -----                 -------
-   |                |
-   |                this parameter and the return type are declared with different lifetimes...
+   |            --  - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `self` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
index 4b4fdde940f..614034794bd 100644
--- a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2b-push-no-existing-names.rs:16:5
    |
 LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |                    --------      -------- these two types are declared with different lifetimes...
+   |                    --------      -------- lifetime `'1` appears in this type
+   |                    |
+   |                    lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
index f55fd291249..c34278b4d9f 100644
--- a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let z = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2c-push-inference-variable.rs:17:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 LL |     let z = Ref { data: y.data };
 LL |     x.push(z); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
index 85b5f3e8900..3097d18e86c 100644
--- a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2d-push-inference-variable-2.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     a.push(b);
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
index 7e5182a5d30..ce0e9be3006 100644
--- a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2e-push-inference-variable-3.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     Vec::push(a, b);
-   |     ^^^^^^^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
index 36317c4570b..c7f1a0ede3c 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     *v = x; //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-2.rs:12:5
    |
 LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
-   |                                   ---           --- these two types are declared with different lifetimes...
+   |                                   -             - let's call the lifetime of this reference `'1`
+   |                                   |
+   |                                   let's call the lifetime of this reference `'2`
 LL |     *v = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^ ...but data from `x` flows here
+   |     ^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
index c43c4ce3a0c..09980e44c52 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
@@ -10,22 +10,25 @@ warning: not reporting region error due to nll
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
    |               ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                     ---                 --- these two types are declared with different lifetimes...
+   |                     -                   - let's call the lifetime of this reference `'1`
+   |                     |
+   |                     let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                         ---                  --- these two types are declared with different lifetimes...
+   |                         -                    - let's call the lifetime of this reference `'1`
+   |                         |
+   |                         let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
index 191389b7706..2829fbcd32a 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:5
    |
 LL | fn foo(mut x: Ref, y: Ref) {
-   |               ---     --- these two types are declared with different lifetimes...
+   |               ---     --- lifetime `'1` appears in this type
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
index 159367cc9d2..8171ee758b0 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
index 3bbcbdd6681..99b64605bae 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
index 2a5729952e3..aed0dcc1a67 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 ...
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
index 6efc8d3da06..7790d37d1c4 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
index 0f555020822..c9542d31069 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:5
    |
 LL | fn foo(mut x: Vec<Ref>, y: Ref) {
-   |                   ---      --- these two types are declared with different lifetimes...
+   |                   ---      --- lifetime `'1` appears in this type
+   |                   |
+   |                   lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
index 4400644e7fb..459a93813a8 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:5
    |
 LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
-   |                           ------      ------ these two types are declared with different lifetimes...
+   |        -- -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
index 93f2837c0fc..459796760e1 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
@@ -4,15 +4,15 @@ warning: not reporting region error due to nll
 LL |     y = x.b; //~ ERROR lifetime mismatch
    |         ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ----
+   |               ---     - let's call the lifetime of this reference `'2`
    |               |
-   |               these two types are declared with different lifetimes...
+   |               lifetime `'1` appears in this type
 LL |     y = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error[E0384]: cannot assign to immutable argument `y`
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
@@ -24,5 +24,4 @@ LL |     y = x.b; //~ ERROR lifetime mismatch
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0384, E0623.
-For more information about an error, try `rustc --explain E0384`.
+For more information about this error, try `rustc --explain E0384`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
index e7fb67f117f..5fc1755ed39 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
index af9e3a42664..835f95880a7 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
index 5437beaab65..7aed5fe626f 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
index 42e1d42a32c..22581d9b075 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
    |
 LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
-   |                        ----     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |              -         - let's call the lifetime of this reference `'1`
+   |              |
+   |              let's call the lifetime of this reference `'2`
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
index 26b0488cfdc..908526d439e 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                   ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:9
    |
 LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
-   |                          ----     ----
-   |                          |
-   |                          this parameter and the return type are declared with different lifetimes...
+   |                -         - let's call the lifetime of this reference `'1`
+   |                |
+   |                let's call the lifetime of this reference `'2`
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `x` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
index a0aa1e28d9b..2829ec35000 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                               ---      --- these two types are declared with different lifetimes...
+   |                        - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                        - help: consider changing this to be mutable: `mut y`
+   |                               -        - let's call the lifetime of this reference `'1`
+   |                               |
+   |                               let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
index 5d4492701be..44d68df4b55 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |         x.push(y); //~ ERROR lifetime mismatch
    |                ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:9
    |
 LL |     fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                        ---      --- these two types are declared with different lifetimes...
+   |                        -        - let's call the lifetime of this reference `'1`
+   |                        |
+   |                        let's call the lifetime of this reference `'2`
 LL |         x.push(y); //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |         ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
index 37b79cee72f..5d3c6f38ad8 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                 ---  --- these two types are declared with different lifetimes...
+   |                              - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                              - help: consider changing this to be mutable: `mut y`
+   |                                     -        - let's call the lifetime of this reference `'1`
+   |                                     |
+   |                                     let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
index c11d81a4c13..6460e5d687f 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions.rs:12:5
    |
 LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                    ---      --- these two types are declared with different lifetimes...
+   |                    -        - let's call the lifetime of this reference `'1`
+   |                    |
+   |                    let's call the lifetime of this reference `'2`
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
index da8ce55162f..d79be8b83c6 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
@@ -51,7 +51,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-        //~^ ERROR lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
index 2704a325314..fe67ca0293e 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-ref.rs:53:5
-   |
-LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                  -------                -------
-   |                                  |
-   |                                  these two types are declared with different lifetimes...
-LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-ref.rs:52:1
    |
 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-ref.rs:53:5
+   |
+LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |             --  -- lifetime `'b` defined here
+   |             |
+   |             lifetime `'a` defined here
+LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
index 0449dc1d1a7..bf24557398d 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
@@ -44,7 +44,7 @@ fn demand_y<'x, 'y>(_outlives1: Cell<&&'x u32>, _outlives2: Cell<&'y &u32>, _y:
 #[rustc_regions]
 fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-        //~^ ERROR lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
index 3cd9e9dd5b0..ed1fc6e1a71 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
    |  _____________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-val.rs:46:5
-   |
-LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                -------                -------
-   |                                |
-   |                                these two types are declared with different lifetimes...
-LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-val.rs:45:1
    |
 LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-val.rs:46:5
+   |
+LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |           --  -- lifetime `'b` defined here
+   |           |
+   |           lifetime `'a` defined here
+LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
index 8598668bef5..a883e7b1994 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
+++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
@@ -18,7 +18,7 @@
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
     &*x
         //~^ WARN not reporting region error due to nll
-        //~| ERROR lifetime mismatch
+        //~| ERROR unsatisfied lifetime constraints
 }
 
 fn main() { }
diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr
index 415aefdeee9..cf3f4df19ae 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr
+++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     &*x
    |     ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/region-lbr1-does-not-outlive-ebr2.rs:19:5
    |
 LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
-   |                   -------                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     &*x
-   |     ^^^ ...but data from `x` is returned here
+   |     ^^^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/nll/issue-52113.rs b/src/test/ui/nll/issue-52113.rs
index 1c509c5d224..e484c249d84 100644
--- a/src/test/ui/nll/issue-52113.rs
+++ b/src/test/ui/nll/issue-52113.rs
@@ -40,7 +40,7 @@ fn produce3<'a, 'b: 'a>(data: &'a mut Vec<&'a u32>, value: &'b u32) -> impl Bazi
 }
 
 fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-    let x = move || { //~ ERROR lifetime mismatch
+    let x = move || { //~ ERROR unsatisfied lifetime constraints
         let value: &'a u32 = value;
         data.push(value);
     };
diff --git a/src/test/ui/nll/issue-52113.stderr b/src/test/ui/nll/issue-52113.stderr
index 4a7c10c3f1a..b21539361e6 100644
--- a/src/test/ui/nll/issue-52113.stderr
+++ b/src/test/ui/nll/issue-52113.stderr
@@ -1,11 +1,12 @@
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/issue-52113.rs:43:9
    |
 LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-   |                                  --------------------         ------- these two types are declared with different lifetimes...
-LL |     let x = move || { //~ ERROR lifetime mismatch
-   |         ^ ...but data from `value` flows into `data` here
+   |                --  -- lifetime `'b` defined here
+   |                |
+   |                lifetime `'a` defined here
+LL |     let x = move || { //~ ERROR unsatisfied lifetime constraints
+   |         ^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.