about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2018-08-07 21:48:50 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2018-08-14 20:35:47 +0100
commit371c23fe34ceacf483a3ba72c7bec7459773440f (patch)
treeea89d04fa3dd33738fff31f7f04b08e255aff230
parent372e4aee1de04517bb6f4b187d00f076499d7b15 (diff)
downloadrust-371c23fe34ceacf483a3ba72c7bec7459773440f.tar.gz
rust-371c23fe34ceacf483a3ba72c7bec7459773440f.zip
Update tests
-rw-r--r--src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr4
-rw-r--r--src/test/ui/in-band-lifetimes/mismatched.nll.stderr2
-rw-r--r--src/test/ui/issues/issue-14285.nll.stderr4
-rw-r--r--src/test/ui/issues/issue-15034.nll.stderr4
-rw-r--r--src/test/ui/issues/issue-3154.nll.stderr4
-rw-r--r--src/test/ui/issues/issue-40510-1.nll.stderr2
-rw-r--r--src/test/ui/issues/issue-40510-3.nll.stderr2
-rw-r--r--src/test/ui/issues/issue-49824.nll.stderr2
-rw-r--r--src/test/ui/issues/issue-52213.nll.stderr4
-rw-r--r--src/test/ui/issues/issue-52533-1.nll.stderr2
-rw-r--r--src/test/ui/issues/issue-52533.nll.stderr2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr16
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr7
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr8
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr4
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr4
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr2
-rw-r--r--src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr2
-rw-r--r--src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr2
-rw-r--r--src/test/ui/nll/issue-48238.stderr2
-rw-r--r--src/test/ui/nll/mir_check_cast_closure.rs2
-rw-r--r--src/test/ui/nll/mir_check_cast_closure.stderr7
-rw-r--r--src/test/ui/nll/mir_check_cast_reify.stderr6
-rw-r--r--src/test/ui/nll/mir_check_cast_unsafe_fn.stderr6
-rw-r--r--src/test/ui/nll/mir_check_cast_unsize.stderr2
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr2
33 files changed, 63 insertions, 65 deletions
diff --git a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
index 3f9104373d6..caedc79d807 100644
--- a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
+++ b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
@@ -5,10 +5,10 @@ LL |     invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
    |     ^^^^^^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
+  --> $DIR/E0621-does-not-trigger-for-closures.rs:25:45
    |
 LL |     invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
-   |                    --    ^^^^^ requires that `'1` must outlive `'2`
+   |                    --                       ^ returning this value requires that `'1` must outlive `'2`
    |                    ||
    |                    |return type of closure is &'2 i32
    |                    has type `&'1 i32`
diff --git a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
index 1470783c206..c07921bce2d 100644
--- a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
@@ -22,7 +22,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/mismatched.rs:16:46
    |
 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
-   |             --          --                   ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |             --          --                   ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
    |             |           |
    |             |           lifetime `'b` defined here
    |             lifetime `'a` defined here
diff --git a/src/test/ui/issues/issue-14285.nll.stderr b/src/test/ui/issues/issue-14285.nll.stderr
index c95d540b25c..cf3e44f7874 100644
--- a/src/test/ui/issues/issue-14285.nll.stderr
+++ b/src/test/ui/issues/issue-14285.nll.stderr
@@ -5,12 +5,12 @@ LL |     B(a)    //~ ERROR 22:5: 22:9: explicit lifetime required in the type of
    |       ^
 
 error[E0621]: explicit lifetime required in the type of `a`
-  --> $DIR/issue-14285.rs:22:7
+  --> $DIR/issue-14285.rs:22:5
    |
 LL | fn foo<'a>(a: &Foo) -> B<'a> {
    |               ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
 LL |     B(a)    //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
-   |       ^ lifetime `'a` required
+   |     ^^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-15034.nll.stderr b/src/test/ui/issues/issue-15034.nll.stderr
index 4c8482630c5..8dd18fa0cab 100644
--- a/src/test/ui/issues/issue-15034.nll.stderr
+++ b/src/test/ui/issues/issue-15034.nll.stderr
@@ -5,12 +5,12 @@ LL |         Parser { lexer: lexer }
    |         ^^^^^^
 
 error[E0621]: explicit lifetime required in the type of `lexer`
-  --> $DIR/issue-15034.rs:27:25
+  --> $DIR/issue-15034.rs:27:9
    |
 LL |     pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
    |                       ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
 LL |         Parser { lexer: lexer }
-   |                         ^^^^^ lifetime `'a` required
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-3154.nll.stderr b/src/test/ui/issues/issue-3154.nll.stderr
index 91010bd3209..3cd7ce8cd54 100644
--- a/src/test/ui/issues/issue-3154.nll.stderr
+++ b/src/test/ui/issues/issue-3154.nll.stderr
@@ -11,12 +11,12 @@ LL |     thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the
    |     ^^^^^
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/issue-3154.rs:16:15
+  --> $DIR/issue-3154.rs:16:5
    |
 LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
    |                   -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
 LL |     thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
-   |               ^ lifetime `'a` required
+   |     ^^^^^^^^^^^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-40510-1.nll.stderr b/src/test/ui/issues/issue-40510-1.nll.stderr
index 6c77bcb2757..3a579c04de1 100644
--- a/src/test/ui/issues/issue-40510-1.nll.stderr
+++ b/src/test/ui/issues/issue-40510-1.nll.stderr
@@ -7,7 +7,7 @@ LL |     || {
    |     |return type of closure is &'2 mut std::boxed::Box<()>
    |     lifetime `'1` represents this closure's body
 LL |         &mut x
-   |         ^^^^^^ return requires that `'1` must outlive `'2`
+   |         ^^^^^^ returning this value requires that `'1` must outlive `'2`
    |
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
diff --git a/src/test/ui/issues/issue-40510-3.nll.stderr b/src/test/ui/issues/issue-40510-3.nll.stderr
index 8aeef86c2e8..84ab2a8216d 100644
--- a/src/test/ui/issues/issue-40510-3.nll.stderr
+++ b/src/test/ui/issues/issue-40510-3.nll.stderr
@@ -9,7 +9,7 @@ LL |       || {
 LL | /         || {
 LL | |             x.push(())
 LL | |         }
-   | |_________^ requires that `'1` must outlive `'2`
+   | |_________^ returning this value requires that `'1` must outlive `'2`
    |
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
diff --git a/src/test/ui/issues/issue-49824.nll.stderr b/src/test/ui/issues/issue-49824.nll.stderr
index fb4bed76a71..df43158ec9c 100644
--- a/src/test/ui/issues/issue-49824.nll.stderr
+++ b/src/test/ui/issues/issue-49824.nll.stderr
@@ -9,7 +9,7 @@ LL |       || {
 LL | /         || {
 LL | |             let _y = &mut x;
 LL | |         }
-   | |_________^ requires that `'1` must outlive `'2`
+   | |_________^ returning this value requires that `'1` must outlive `'2`
    |
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
diff --git a/src/test/ui/issues/issue-52213.nll.stderr b/src/test/ui/issues/issue-52213.nll.stderr
index 4e1efc96490..7a04aeb9635 100644
--- a/src/test/ui/issues/issue-52213.nll.stderr
+++ b/src/test/ui/issues/issue-52213.nll.stderr
@@ -5,7 +5,7 @@ LL |     match (&t,) { //~ ERROR cannot infer an appropriate lifetime
    |           ^^^^^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/issue-52213.rs:13:11
+  --> $DIR/issue-52213.rs:13:20
    |
 LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
    |                       --  -- lifetime `'b` defined here
@@ -13,7 +13,7 @@ LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
    |                       lifetime `'a` defined here
 LL |     match (&t,) { //~ ERROR cannot infer an appropriate lifetime
 LL |         ((u,),) => u,
-   |           ^ requires that `'a` must outlive `'b`
+   |                    ^ returning this value requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-52533-1.nll.stderr b/src/test/ui/issues/issue-52533-1.nll.stderr
index 87fda1dd99c..2dfa46dc228 100644
--- a/src/test/ui/issues/issue-52533-1.nll.stderr
+++ b/src/test/ui/issues/issue-52533-1.nll.stderr
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-52533-1.rs:19:18
    |
 LL |     gimme(|x, y| y)
-   |            -  -  ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
+   |            -  -  ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
    |            |  |
    |            |  has type `&Foo<'_, '1, u32>`
    |            has type `&Foo<'_, '2, u32>`
diff --git a/src/test/ui/issues/issue-52533.nll.stderr b/src/test/ui/issues/issue-52533.nll.stderr
index a13b06e3204..17218429822 100644
--- a/src/test/ui/issues/issue-52533.nll.stderr
+++ b/src/test/ui/issues/issue-52533.nll.stderr
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-52533.rs:15:16
    |
 LL |     foo(|a, b| b)
-   |          -  -  ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
+   |          -  -  ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
    |          |  |
    |          |  has type `&'1 u32`
    |          has type `&'2 u32`
diff --git a/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
index 89313f898d5..3fb0252315c 100644
--- a/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
@@ -5,17 +5,13 @@ LL |         &*x //~ ERROR explicit lifetime
    |         ^^^
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/42701_one_named_and_one_anonymous.rs:16:5
+  --> $DIR/42701_one_named_and_one_anonymous.rs:20:9
    |
-LL |   fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
-   |                              ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
-LL | /     if true {
-LL | |         let p: &i32 = &a.field;
-LL | |         &*p
-LL | |     } else {
-LL | |         &*x //~ ERROR explicit lifetime
-LL | |     }
-   | |_____^ lifetime `'a` required
+LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
+   |                            ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
+...
+LL |         &*x //~ ERROR explicit lifetime
+   |         ^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
index 3976cb30426..817d7c87363 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
@@ -5,12 +5,13 @@ LL |                     other //~ ERROR explicit lifetime
    |                     ^^^^^
 
 error[E0621]: explicit lifetime required in the type of `other`
-  --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:18:15
+  --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
    |
 LL |     fn bar(&self, other: Foo) -> Foo<'a> {
    |                          --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
-LL |         match *self {
-   |               ^^^^^ lifetime `'a` required
+...
+LL |                     other //~ ERROR explicit lifetime
+   |                     ^^^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
index 00eff2fe3ae..a10c38a88d4 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
@@ -5,12 +5,12 @@ LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                ^
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
+  --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
-   |        ^^^^^ lifetime `'a` required
+   |                ^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
index a3b46aa04a6..e33b89c56d5 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
@@ -5,12 +5,12 @@ LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^
 
 error[E0621]: explicit lifetime required in parameter type
-  --> $DIR/ex1-return-one-existing-name-if-else-3.rs:11:16
+  --> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
    |
 LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-   |                ^   --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
-   |                |
-   |                lifetime `'a` required
+   |                    --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
+LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
+   |                           ^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
index 465b33be2d0..a3b2c3f6f19 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
@@ -5,12 +5,12 @@ LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |               ^
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:7
+  --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
-   |       ^^^^^ lifetime `'a` required
+   |               ^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
index a62d7cc5a6f..e13a710508d 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
@@ -5,13 +5,13 @@ LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |                                    ^
 
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
+  --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
    |
 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
    |                           ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL | 
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
+   |                                    ^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
index b6bf646132e..4ce3a613c31 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
@@ -5,7 +5,7 @@ LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
    |                    ^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:12
+  --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:20
    |
 LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |            --     - let's call the lifetime of this reference `'1`
@@ -13,7 +13,7 @@ LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |            lifetime `'a` defined here
 LL | 
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
-   |            ^^^^^ requires that `'1` must outlive `'a`
+   |                    ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
index 93f8254f825..5b4b28acee7 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
@@ -5,12 +5,12 @@ LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^
 
 error[E0621]: explicit lifetime required in the type of `y`
-  --> $DIR/ex1-return-one-existing-name-if-else.rs:12:8
+  --> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
    |
 LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
    |                           ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
-   |        ^^^^^ lifetime `'a` required
+   |                           ^ lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
index 93eac05e8d2..272ae0b1251 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
@@ -13,7 +13,7 @@ LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
    |          lifetime `'a` defined here
 LL | 
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
+   |     ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
index c5b4fd1934b..2106546325b 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
@@ -5,7 +5,7 @@ LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                              ^^^^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:9
+  --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:30
    |
 LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
    |            --  - let's call the lifetime of this reference `'1`
@@ -13,7 +13,7 @@ LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
    |            lifetime `'a` defined here
 LL | 
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'a`
+   |                              ^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
index 22581d9b075..9680e8c2f69 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
@@ -12,7 +12,7 @@ LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
    |              |
    |              let's call the lifetime of this reference `'2`
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
+   |     ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
index 908526d439e..6fbe8e98209 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
@@ -5,14 +5,14 @@ LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                   ^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:9
+  --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:19
    |
 LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
    |                -         - 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
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'2`
+   |                   ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
index 116ff6ef023..00d79a9ed7e 100644
--- a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
+++ b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
@@ -10,7 +10,7 @@ error: unsatisfied lifetime constraints
 LL | fn foo<'a>(x: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
 LL |     &*x
-   |     ^^^ requires that `'a` must outlive `'static`
+   |     ^^^ returning this value requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
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 cf3f4df19ae..bcdae17c47c 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
@@ -12,7 +12,7 @@ LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
    |        |
    |        lifetime `'a` defined here
 LL |     &*x
-   |     ^^^ requires that `'a` must outlive `'b`
+   |     ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
index d2e088815e1..8dc10de702f 100644
--- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
+++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
@@ -19,7 +19,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/return-wrong-bound-region.rs:21:23
    |
 LL |     expect_sig(|a, b| b); // ought to return `a`
-   |                 -  -  ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
+   |                 -  -  ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
    |                 |  |
    |                 |  has type `&'1 i32`
    |                 has type `&'2 i32`
diff --git a/src/test/ui/nll/issue-48238.stderr b/src/test/ui/nll/issue-48238.stderr
index 84d0730025a..a48516efdc2 100644
--- a/src/test/ui/nll/issue-48238.stderr
+++ b/src/test/ui/nll/issue-48238.stderr
@@ -2,7 +2,7 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-48238.rs:21:13
    |
 LL |     move || use_val(&orig); //~ ERROR
-   |     ------- ^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |     ------- ^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
    |     |     |
    |     |     return type of closure is &'2 u8
    |     lifetime `'1` represents this closure's body
diff --git a/src/test/ui/nll/mir_check_cast_closure.rs b/src/test/ui/nll/mir_check_cast_closure.rs
index 2200c1569e5..a111699c3f7 100644
--- a/src/test/ui/nll/mir_check_cast_closure.rs
+++ b/src/test/ui/nll/mir_check_cast_closure.rs
@@ -14,9 +14,9 @@
 
 fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
     let g: fn(_, _) -> _ = |_x, y| y;
-    //~^ ERROR unsatisfied lifetime constraints
     g
     //~^ WARNING not reporting region error due to nll
+    //~^^ ERROR unsatisfied lifetime constraints
 }
 
 fn main() {}
diff --git a/src/test/ui/nll/mir_check_cast_closure.stderr b/src/test/ui/nll/mir_check_cast_closure.stderr
index cdc407985fe..6805dbf6f30 100644
--- a/src/test/ui/nll/mir_check_cast_closure.stderr
+++ b/src/test/ui/nll/mir_check_cast_closure.stderr
@@ -1,18 +1,19 @@
 warning: not reporting region error due to nll
-  --> $DIR/mir_check_cast_closure.rs:18:5
+  --> $DIR/mir_check_cast_closure.rs:17:5
    |
 LL |     g
    |     ^
 
 error: unsatisfied lifetime constraints
-  --> $DIR/mir_check_cast_closure.rs:16:28
+  --> $DIR/mir_check_cast_closure.rs:17:5
    |
 LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
    |        --  -- lifetime `'b` defined here
    |        |
    |        lifetime `'a` defined here
 LL |     let g: fn(_, _) -> _ = |_x, y| y;
-   |                            ^^^^^^^^^ cast requires that `'b` must outlive `'a`
+LL |     g
+   |     ^ returning this value requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/mir_check_cast_reify.stderr b/src/test/ui/nll/mir_check_cast_reify.stderr
index d8f186a2232..c6e5fb397b9 100644
--- a/src/test/ui/nll/mir_check_cast_reify.stderr
+++ b/src/test/ui/nll/mir_check_cast_reify.stderr
@@ -4,14 +4,14 @@ warning: not reporting region error due to nll
 LL |     let f: fn(_) -> _ = foo;
    |                         ^^^
 
-error: borrowed data escapes outside of function
+error: unsatisfied lifetime constraints
   --> $DIR/mir_check_cast_reify.rs:48:5
    |
 LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
-   |            - `x` is a reference that is only valid in the function body
+   |        -- lifetime `'a` defined here
 ...
 LL |     f(x)
-   |     ^^^^ `x` escapes the function body here
+   |     ^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
index 98c03e37814..e8315d341a7 100644
--- a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
+++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
@@ -4,14 +4,14 @@ warning: not reporting region error due to nll
 LL |     let g: unsafe fn(_) -> _ = f;
    |                                ^
 
-error: borrowed data escapes outside of function
+error: unsatisfied lifetime constraints
   --> $DIR/mir_check_cast_unsafe_fn.rs:20:14
    |
 LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
-   |            ----- `input` is a reference that is only valid in the function body
+   |        -- lifetime `'a` defined here
 ...
 LL |     unsafe { g(input) }
-   |              ^^^^^^^^ `input` escapes the function body here
+   |              ^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/mir_check_cast_unsize.stderr b/src/test/ui/nll/mir_check_cast_unsize.stderr
index 02ecd05e5f9..4219c07673a 100644
--- a/src/test/ui/nll/mir_check_cast_unsize.stderr
+++ b/src/test/ui/nll/mir_check_cast_unsize.stderr
@@ -15,7 +15,7 @@ LL | |     //~^ ERROR unsatisfied lifetime constraints
 LL | |     x
 LL | |     //~^ WARNING not reporting region error due to nll
 LL | | }
-   | |_^ return requires that `'a` must outlive `'static`
+   | |_^ returning this value requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
index 5b4c669c66e..799b0982b94 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
@@ -32,7 +32,7 @@ LL |   fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
 LL | |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
 LL | |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
 LL | | }
-   | |_^ return requires that `'1` must outlive `'static`
+   | |_^ returning this value requires that `'1` must outlive `'static`
 
 error: aborting due to previous error