From a19db49c863f28103a3ae64423b88574ccf700ff Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Tue, 14 Aug 2018 21:26:33 +0100 Subject: [PATCH] Update former compile-fail tests --- ...fn-ret-contravariant.krisskross.nll.stderr | 4 ++-- ...-fn-ret-contravariant.transmute.nll.stderr | 6 ++--- ...ect-fn-ret-invariant.krisskross.nll.stderr | 4 ++-- ...ject-fn-ret-invariant.transmute.nll.stderr | 6 ++--- .../borrowck-describe-lvalue.ast.nll.stderr | 2 +- .../borrowck-describe-lvalue.mir.stderr | 2 +- ...orrow-from-shorter-lived-andmut.nll.stderr | 4 ++-- ...t_outlive_least_region_or_bound.nll.stderr | 6 ++--- src/test/ui/lub-if.nll.stderr | 14 ++++++----- src/test/ui/lub-match.nll.stderr | 14 ++++++----- .../match/match-ref-mut-invariance.nll.stderr | 2 +- .../match-ref-mut-let-invariance.nll.stderr | 2 +- ...object-lifetime-default-elision.nll.stderr | 2 +- .../object-lifetime-default-mybox.nll.stderr | 2 +- .../region-object-lifetime-2.nll.stderr | 8 ++++--- ...ion-object-lifetime-in-coercion.nll.stderr | 2 +- src/test/ui/regions/regions-bounds.nll.stderr | 4 ++-- ...ions-close-object-into-object-2.nll.stderr | 2 +- ...ions-close-object-into-object-4.nll.stderr | 2 +- .../regions-creating-enums3.nll.stderr | 4 ++-- .../regions-creating-enums4.nll.stderr | 4 ++-- ...egions-early-bound-error-method.nll.stderr | 2 +- .../regions-early-bound-error.nll.stderr | 2 +- .../regions/regions-escape-method.nll.stderr | 2 +- ...regions-escape-via-trait-or-not.nll.stderr | 2 +- ...ons-free-region-ordering-callee.nll.stderr | 2 +- ...-free-region-ordering-incorrect.nll.stderr | 2 +- .../regions/regions-glb-free-free.nll.stderr | 16 ++++++++----- .../regions/regions-infer-call-3.nll.stderr | 9 +++---- ...ns-infer-invariance-due-to-decl.nll.stderr | 2 +- ...-invariance-due-to-mutability-3.nll.stderr | 2 +- ...-invariance-due-to-mutability-4.nll.stderr | 2 +- .../regions-infer-not-param.nll.stderr | 6 ++--- ...ow-from-shorter-mut-ref-mut-ref.nll.stderr | 2 +- ...s-reborrow-from-shorter-mut-ref.nll.stderr | 2 +- .../regions/regions-ret-borrowed-1.nll.stderr | 2 +- .../regions/regions-ret-borrowed.nll.stderr | 2 +- ...return-ref-to-upvar-issue-17403.nll.stderr | 2 +- .../regions-static-bound.ll.nll.stderr | 2 +- .../regions/regions-static-bound.nll.stderr | 2 +- .../regions-trait-object-subtyping.nll.stderr | 4 ++-- .../variance-btree-invariant-types.nll.stderr | 24 +++++++++---------- ...ance-use-contravariant-struct-1.nll.stderr | 2 +- ...variance-use-covariant-struct-1.nll.stderr | 2 +- ...variance-use-invariant-struct-1.nll.stderr | 4 ++-- src/test/ui/wf/wf-static-method.nll.stderr | 4 ++-- 46 files changed, 105 insertions(+), 94 deletions(-) diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr index 89a7bb00f74e1..ac758a8926f28 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr @@ -18,7 +18,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | | | lifetime `'a` defined here LL | let a = bar(foo, y); - | ^^^^^^^^^^^ argument requires that `'b` must outlive `'a` + | ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a` error: unsatisfied lifetime constraints --> $DIR/project-fn-ret-contravariant.rs:54:12 @@ -29,7 +29,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | lifetime `'a` defined here LL | let a = bar(foo, y); LL | let b = bar(foo, x); - | ^^^^^^^^^^^ argument requires that `'a` must outlive `'b` + | ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr index 793209b7cbcef..75c35d077c4c4 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr @@ -4,13 +4,13 @@ warning: not reporting region error due to nll LL | bar(foo, x) //[transmute]~ ERROR E0495 | ^^^ -error: borrowed data escapes outside of function +error: unsatisfied lifetime constraints --> $DIR/project-fn-ret-contravariant.rs:48:4 | LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { - | - `x` is a reference that is only valid in the function body + | -- lifetime `'a` defined here LL | bar(foo, x) //[transmute]~ ERROR E0495 - | ^^^^^^^^^^^ `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/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr index dedce3121569c..4b2ba24eb0eb8 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr @@ -18,7 +18,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { | | | lifetime `'a` defined here LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 - | ^^^^^^^^^^^ argument requires that `'b` must outlive `'a` + | ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a` error: unsatisfied lifetime constraints --> $DIR/project-fn-ret-invariant.rs:64:12 @@ -29,7 +29,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { | lifetime `'a` defined here LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 LL | let b = bar(foo, x); - | ^^^^^^^^^^^ argument requires that `'a` must outlive `'b` + | ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr index ed3f2a07aa2e7..604974a25008d 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr @@ -4,14 +4,14 @@ warning: not reporting region error due to nll LL | bar(foo, x) //[transmute]~ ERROR E0495 | ^^^ -error: borrowed data escapes outside of function +error: unsatisfied lifetime constraints --> $DIR/project-fn-ret-invariant.rs:58:4 | LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { - | - `x` is a reference that is only valid in the function body + | -- lifetime `'a` defined here ... LL | bar(foo, x) //[transmute]~ ERROR E0495 - | ^^^^^^^^^^^ `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/borrowck/borrowck-describe-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr index c8170436e05f2..ae706ef64dd22 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr @@ -35,7 +35,7 @@ LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than LL | | *y = 1; LL | | drop(y); 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/borrowck/borrowck-describe-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr index c8170436e05f2..ae706ef64dd22 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr @@ -35,7 +35,7 @@ LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than LL | | *y = 1; LL | | drop(y); 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/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr index 43c2a84c95780..b7aad5c2b80dc 100644 --- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr +++ b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr @@ -5,14 +5,14 @@ LL | S { pointer: &mut *p.pointer } | ^^^^^^^^^^^^^^^ error: unsatisfied lifetime constraints - --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:18 + --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:5 | LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here LL | S { pointer: &mut *p.pointer } - | ^^^^^^^^^^^^^^^ 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/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr index 6d581952ac944..97cb2cc16e45e 100644 --- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr +++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr @@ -40,13 +40,13 @@ error: unsatisfied lifetime constraints --> $DIR/must_outlive_least_region_or_bound.rs:16:44 | LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } - | -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static` + | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/must_outlive_least_region_or_bound.rs:22:69 | LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } - | -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static` + | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/must_outlive_least_region_or_bound.rs:29:5 @@ -57,7 +57,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32 | lifetime `'a` defined here LL | //~^ ERROR lifetime mismatch LL | move |_| println!("{}", y) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 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` error[E0310]: the parameter type `T` may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:34:5 diff --git a/src/test/ui/lub-if.nll.stderr b/src/test/ui/lub-if.nll.stderr index a34e280bfa601..d3f5cdca1759e 100644 --- a/src/test/ui/lub-if.nll.stderr +++ b/src/test/ui/lub-if.nll.stderr @@ -11,20 +11,22 @@ LL | s //~ ERROR E0312 | ^ error: unsatisfied lifetime constraints - --> $DIR/lub-if.rs:34:8 + --> $DIR/lub-if.rs:38:9 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here -LL | if maybestr.is_none() { - | ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` +... +LL | s //~ ERROR E0312 + | ^ returning this value requires that `'a` must outlive `'static` error: unsatisfied lifetime constraints - --> $DIR/lub-if.rs:43:8 + --> $DIR/lub-if.rs:45:9 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here -LL | if maybestr.is_some() { - | ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` +... +LL | s //~ ERROR E0312 + | ^ returning this value requires that `'a` must outlive `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/lub-match.nll.stderr b/src/test/ui/lub-match.nll.stderr index 22bd6ea4081b4..bbddcc7d8b36a 100644 --- a/src/test/ui/lub-match.nll.stderr +++ b/src/test/ui/lub-match.nll.stderr @@ -11,20 +11,22 @@ LL | s //~ ERROR E0312 | ^ error: unsatisfied lifetime constraints - --> $DIR/lub-match.rs:36:11 + --> $DIR/lub-match.rs:40:13 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here -LL | match *maybestr { - | ^^^^^^^^^ requires that `'a` must outlive `'static` +... +LL | s //~ ERROR E0312 + | ^ returning this value requires that `'a` must outlive `'static` error: unsatisfied lifetime constraints - --> $DIR/lub-match.rs:46:11 + --> $DIR/lub-match.rs:49:13 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here -LL | match *maybestr { - | ^^^^^^^^^ requires that `'a` must outlive `'static` +... +LL | s //~ ERROR E0312 + | ^ returning this value requires that `'a` must outlive `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/match/match-ref-mut-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-invariance.nll.stderr index cabf933bb81da..26fcaa65d77f9 100644 --- a/src/test/ui/match/match-ref-mut-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.nll.stderr @@ -15,7 +15,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { | | lifetime `'a` defined here LL | | match self.0 { ref mut x => x } //~ ERROR mismatched types LL | | } - | |_____^ 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/match/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr index f01a9f3a3b0b3..b1ec6adee9ea0 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr @@ -16,7 +16,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { LL | | let ref mut x = self.0; LL | | x //~ ERROR mismatched types LL | | } - | |_____^ 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/object-lifetime/object-lifetime-default-elision.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr index 509d35a94332f..0d21dddc7c9bc 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr @@ -18,7 +18,7 @@ LL | | // for<'a,'b,'c>fn(&'a (SomeTrait+'c)) -> &'b (SomeTrait+'a) ... | LL | | //~| ERROR cannot infer LL | | } - | |_^ return 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/object-lifetime/object-lifetime-default-mybox.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr index f76a03d078b9e..14a3cbf9e2948 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr @@ -19,7 +19,7 @@ LL | fn load1<'a,'b>(a: &'a MyBox, | lifetime `'a` defined here ... LL | a //~ ERROR lifetime mismatch - | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` error: borrowed data escapes outside of function --> $DIR/object-lifetime-default-mybox.rs:41:5 diff --git a/src/test/ui/regions/region-object-lifetime-2.nll.stderr b/src/test/ui/regions/region-object-lifetime-2.nll.stderr index 4395fee02c4ee..135a115cecfa5 100644 --- a/src/test/ui/regions/region-object-lifetime-2.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-2.nll.stderr @@ -4,13 +4,15 @@ warning: not reporting region error due to nll LL | x.borrowed() //~ ERROR cannot infer | ^^^^^^^^ -error: borrowed data escapes outside of function +error: unsatisfied lifetime constraints --> $DIR/region-object-lifetime-2.rs:20:5 | LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { - | - `x` is a reference that is only valid in the function body + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here LL | x.borrowed() //~ ERROR cannot infer - | ^^^^^^^^^^^^ `x` escapes the function body here + | ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b` error: aborting due to previous error diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr index 87a0a3267ef8a..8338cf6a6069c 100644 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr @@ -67,7 +67,7 @@ LL | fn d<'a,'b>(v: &'a [u8]) -> Box { LL | | Box::new(v) LL | | //~^ ERROR cannot infer an appropriate lifetime due to conflicting LL | | } - | |_^ return requires that `'a` must outlive `'b` + | |_^ returning this value requires that `'a` must outlive `'b` error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-bounds.nll.stderr b/src/test/ui/regions/regions-bounds.nll.stderr index 4d4a30a88c63e..a59a485f444ca 100644 --- a/src/test/ui/regions/regions-bounds.nll.stderr +++ b/src/test/ui/regions/regions-bounds.nll.stderr @@ -18,7 +18,7 @@ LL | fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> { | | | lifetime `'a` defined here LL | return e; //~ ERROR mismatched types - | ^ return requires that `'a` must outlive `'b` + | ^ returning this value requires that `'a` must outlive `'b` error: unsatisfied lifetime constraints --> $DIR/regions-bounds.rs:23:12 @@ -28,7 +28,7 @@ LL | fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> { | | | lifetime `'a` defined here LL | return e; //~ ERROR mismatched types - | ^ return requires that `'a` must outlive `'b` + | ^ returning this value requires that `'a` must outlive `'b` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr index 5258dbe793ae2..701becc24d718 100644 --- a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr @@ -13,7 +13,7 @@ LL | fn g<'a, T: 'static>(v: Box+'a>) -> Box { | | lifetime `'a` defined here LL | | box B(&*v) as Box //~ ERROR cannot infer LL | | } - | |_^ return requires that `'a` must outlive `'static` + | |_^ returning this value requires that `'a` must outlive `'static` error[E0597]: `*v` does not live long enough --> $DIR/regions-close-object-into-object-2.rs:20:11 diff --git a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr index 62146778f68a2..e01ae145e90d9 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr @@ -37,7 +37,7 @@ LL | fn i<'a, T, U>(v: Box+'a>) -> Box { | | lifetime `'a` defined here LL | | box B(&*v) as Box //~ ERROR cannot infer LL | | } - | |_^ return requires that `'a` must outlive `'static` + | |_^ returning this value requires that `'a` must outlive `'static` error[E0310]: the parameter type `U` may not live long enough --> $DIR/regions-close-object-into-object-4.rs:20:5 diff --git a/src/test/ui/regions/regions-creating-enums3.nll.stderr b/src/test/ui/regions/regions-creating-enums3.nll.stderr index 9b327100667fa..462e4152ce3ba 100644 --- a/src/test/ui/regions/regions-creating-enums3.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums3.nll.stderr @@ -5,14 +5,14 @@ LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623] | ^^^^^^^^ error: unsatisfied lifetime constraints - --> $DIR/regions-creating-enums3.rs:17:14 + --> $DIR/regions-creating-enums3.rs:17:5 | LL | fn mk_add_bad1<'a,'b>(x: &'a ast<'a>, y: &'b ast<'b>) -> ast<'a> { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623] - | ^ requires that `'b` must outlive `'a` + | ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-creating-enums4.nll.stderr b/src/test/ui/regions/regions-creating-enums4.nll.stderr index 6a3554b41a77d..b82fdfd5c65c4 100644 --- a/src/test/ui/regions/regions-creating-enums4.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums4.nll.stderr @@ -5,14 +5,14 @@ LL | ast::add(x, y) //~ ERROR cannot infer | ^^^^^^^^ error: unsatisfied lifetime constraints - --> $DIR/regions-creating-enums4.rs:17:14 + --> $DIR/regions-creating-enums4.rs:17:5 | LL | fn mk_add_bad2<'a,'b>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'b> { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here LL | ast::add(x, y) //~ ERROR cannot infer - | ^ 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/regions/regions-early-bound-error-method.nll.stderr b/src/test/ui/regions/regions-early-bound-error-method.nll.stderr index 0319d63d596d6..cd2da8f3c6e72 100644 --- a/src/test/ui/regions/regions-early-bound-error-method.nll.stderr +++ b/src/test/ui/regions/regions-early-bound-error-method.nll.stderr @@ -12,7 +12,7 @@ LL | impl<'a> Box<'a> { LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { | -- lifetime `'b` defined here LL | g2.get() - | ^^^^^^^^ argument requires that `'b` must outlive `'a` + | ^^^^^^^^ returning this value requires that `'b` must outlive `'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-early-bound-error.nll.stderr b/src/test/ui/regions/regions-early-bound-error.nll.stderr index b19de2201f70c..7ba6151173530 100644 --- a/src/test/ui/regions/regions-early-bound-error.nll.stderr +++ b/src/test/ui/regions/regions-early-bound-error.nll.stderr @@ -12,7 +12,7 @@ LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { | | | lifetime `'a` defined here LL | g1.get() - | ^^^^^^^^ argument 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/regions/regions-escape-method.nll.stderr b/src/test/ui/regions/regions-escape-method.nll.stderr index aedb93032bd5d..4603d1516e0f7 100644 --- a/src/test/ui/regions/regions-escape-method.nll.stderr +++ b/src/test/ui/regions/regions-escape-method.nll.stderr @@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-escape-method.rs:25:13 | LL | s.f(|p| p) //~ ERROR cannot infer - | -- ^ return 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/regions/regions-escape-via-trait-or-not.nll.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr index e2a05a141a826..381f462864780 100644 --- a/src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr +++ b/src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr @@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-escape-via-trait-or-not.rs:28:14 | LL | with(|o| o) //~ ERROR cannot infer - | -- ^ return requires that `'1` must outlive `'2` + | -- ^ returning this value requires that `'1` must outlive `'2` | || | |return type of closure is &'2 isize | has type `&'1 isize` diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr index 25f2e1a56573b..3ef1be10f0fdc 100644 --- a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr @@ -19,7 +19,7 @@ LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { | lifetime `'a` defined here LL | // However, it is not safe to assume that 'b <= 'a LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623] - | ^^^ requires that `'a` must outlive `'b` + | ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` error: unsatisfied lifetime constraints --> $DIR/regions-free-region-ordering-callee.rs:28:24 diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr index 34fcd91b319ba..0bc4bf4a951e8 100644 --- a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr @@ -15,7 +15,7 @@ LL | / match self.next { LL | | Some(ref next) => next.get(), LL | | None => &self.val //~ ERROR cannot infer LL | | } - | |_____^ 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/regions/regions-glb-free-free.nll.stderr b/src/test/ui/regions/regions-glb-free-free.nll.stderr index 93e8bd75bdb0f..a82ce96bfbfbf 100644 --- a/src/test/ui/regions/regions-glb-free-free.nll.stderr +++ b/src/test/ui/regions/regions-glb-free-free.nll.stderr @@ -5,13 +5,17 @@ LL | Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in th | ^^^^ error[E0621]: explicit lifetime required in the type of `s` - --> $DIR/regions-glb-free-free.rs:26:23 + --> $DIR/regions-glb-free-free.rs:25:13 | -LL | pub fn set_desc(self, s: &str) -> Flag<'a> { - | ---- help: add explicit lifetime `'a` to the type of `s`: `&'a str` -LL | Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621] -LL | name: self.name, - | ^^^^^^^^^ lifetime `'a` required +LL | pub fn set_desc(self, s: &str) -> Flag<'a> { + | ---- help: add explicit lifetime `'a` to the type of `s`: `&'a str` +LL | / Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621] +LL | | name: self.name, +LL | | desc: s, +LL | | max_count: self.max_count, +LL | | value: self.value +LL | | } + | |_____________^ lifetime `'a` required error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-call-3.nll.stderr b/src/test/ui/regions/regions-infer-call-3.nll.stderr index c8665fe6a1155..6069aca62ec5e 100644 --- a/src/test/ui/regions/regions-infer-call-3.nll.stderr +++ b/src/test/ui/regions/regions-infer-call-3.nll.stderr @@ -4,13 +4,14 @@ warning: not reporting region error due to nll LL | let z = with(|y| { select(x, y) }); | ^^^^^^^^^^^^ -error: borrowed data escapes outside of closure +error: unsatisfied lifetime constraints --> $DIR/regions-infer-call-3.rs:18:24 | LL | let z = with(|y| { select(x, y) }); - | - ^^^^^^^^^^^^ `y` escapes the closure body here - | | - | `y` is a reference that is only valid in the closure body + | -- ^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` + | || + | |return type of closure is &'2 isize + | has type `&'1 isize` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr index 86a7e1f2c48e4..cf754167b53ec 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr @@ -10,7 +10,7 @@ error: unsatisfied lifetime constraints LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { | -- lifetime `'r` defined here LL | b_isize //~ ERROR mismatched types - | ^^^^^^^ return requires that `'r` must outlive `'static` + | ^^^^^^^ returning this value requires that `'r` must outlive `'static` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr index a021239af1e3e..6cd76f26ebec7 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr @@ -10,7 +10,7 @@ error: unsatisfied lifetime constraints LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { | -- lifetime `'r` defined here LL | b_isize //~ ERROR mismatched types - | ^^^^^^^ return requires that `'r` must outlive `'static` + | ^^^^^^^ returning this value requires that `'r` must outlive `'static` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr index 20e0e730c026f..1e1daa59019bd 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr @@ -10,7 +10,7 @@ error: unsatisfied lifetime constraints LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here LL | b_isize //~ ERROR mismatched types - | ^^^^^^^ return requires that `'r` must outlive `'static` + | ^^^^^^^ returning this value requires that `'r` must outlive `'static` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-not-param.nll.stderr b/src/test/ui/regions/regions-infer-not-param.nll.stderr index deeca293a1af6..072be9b5a994e 100644 --- a/src/test/ui/regions/regions-infer-not-param.nll.stderr +++ b/src/test/ui/regions/regions-infer-not-param.nll.stderr @@ -14,7 +14,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-infer-not-param.rs:25:54 | LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types - | -- -- lifetime `'b` defined here ^ return requires that `'a` must outlive `'b` + | -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b` | | | lifetime `'a` defined here @@ -22,7 +22,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-infer-not-param.rs:29:63 | LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types - | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` | | | lifetime `'a` defined here @@ -30,7 +30,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-infer-not-param.rs:29:63 | LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types - | -- -- lifetime `'b` defined here ^ return requires that `'a` must outlive `'b` + | -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b` | | | lifetime `'a` defined here diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr index 761fa6f32ff17..37454ff78a126 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr @@ -14,7 +14,7 @@ LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b | | lifetime `'a` defined here LL | | &mut ***p //~ ERROR 14:5: 14:14: lifetime mismatch [E0623] LL | | } - | |_^ 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/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr index c3eb6fd909721..455ee6f794936 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr @@ -14,7 +14,7 @@ LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { | | lifetime `'a` defined here LL | | &mut **p //~ ERROR 16:5: 16:13: lifetime mismatch [E0623] LL | | } - | |_^ 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/regions/regions-ret-borrowed-1.nll.stderr b/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr index 6a18436654635..29810f5128c9f 100644 --- a/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr +++ b/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr @@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-ret-borrowed-1.rs:20:14 | LL | with(|o| o) - | -- ^ return requires that `'1` must outlive `'2` + | -- ^ returning this value requires that `'1` must outlive `'2` | || | |return type of closure is &'2 isize | has type `&'1 isize` diff --git a/src/test/ui/regions/regions-ret-borrowed.nll.stderr b/src/test/ui/regions/regions-ret-borrowed.nll.stderr index 57c81f45fd004..ab70e6a663039 100644 --- a/src/test/ui/regions/regions-ret-borrowed.nll.stderr +++ b/src/test/ui/regions/regions-ret-borrowed.nll.stderr @@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-ret-borrowed.rs:23:14 | LL | with(|o| o) - | -- ^ return requires that `'1` must outlive `'2` + | -- ^ returning this value requires that `'1` must outlive `'2` | || | |return type of closure is &'2 isize | has type `&'1 isize` diff --git a/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr index eb84dca83c6da..850226f60cf70 100644 --- a/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr +++ b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr @@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 | LL | let mut f = || &mut x; //~ ERROR cannot infer - | -- ^^^^^^ return requires that `'1` must outlive `'2` + | -- ^^^^^^ returning this value requires that `'1` must outlive `'2` | || | |return type of closure is &'2 mut i32 | lifetime `'1` represents this closure's body diff --git a/src/test/ui/regions/regions-static-bound.ll.nll.stderr b/src/test/ui/regions/regions-static-bound.ll.nll.stderr index aaae14fede62e..326111aab7ef0 100644 --- a/src/test/ui/regions/regions-static-bound.ll.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.ll.nll.stderr @@ -22,7 +22,7 @@ error: unsatisfied lifetime constraints LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here LL | t //[ll]~ ERROR E0312 - | ^ return requires that `'a` must outlive `'static` + | ^ returning this value requires that `'a` must outlive `'static` error[E0621]: explicit lifetime required in the type of `u` --> $DIR/regions-static-bound.rs:25:5 diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.nll.stderr index aaae14fede62e..326111aab7ef0 100644 --- a/src/test/ui/regions/regions-static-bound.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.nll.stderr @@ -22,7 +22,7 @@ error: unsatisfied lifetime constraints LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here LL | t //[ll]~ ERROR E0312 - | ^ return requires that `'a` must outlive `'static` + | ^ returning this value requires that `'a` must outlive `'static` error[E0621]: explicit lifetime required in the type of `u` --> $DIR/regions-static-bound.rs:25:5 diff --git a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr b/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr index 3d884f6fc5f97..99bee4a36c1d1 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr @@ -22,7 +22,7 @@ LL | | // Without knowing 'a:'b, we can't coerce LL | | x //~ ERROR lifetime bound not satisfied LL | | //~^ ERROR cannot infer an appropriate lifetime LL | | } - | |_^ return requires that `'a` must outlive `'b` + | |_^ returning this value requires that `'a` must outlive `'b` error: unsatisfied lifetime constraints --> $DIR/regions-trait-object-subtyping.rs:32:5 @@ -33,7 +33,7 @@ LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> { | lifetime `'a` defined here LL | // We can't coerce because it is packed in `Wrapper` LL | x //~ ERROR mismatched types - | ^ return requires that `'b` must outlive `'a` + | ^ returning this value requires that `'b` must outlive `'a` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr index 33230c26b8b0c..877036530ed19 100644 --- a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr +++ b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr @@ -76,7 +76,7 @@ error: unsatisfied lifetime constraints LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { | ---- lifetime `'new` defined here LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:19:5 @@ -84,7 +84,7 @@ error: unsatisfied lifetime constraints LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { | ---- lifetime `'new` defined here LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:22:5 @@ -92,7 +92,7 @@ error: unsatisfied lifetime constraints LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { | ---- lifetime `'new` defined here LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:25:5 @@ -100,7 +100,7 @@ error: unsatisfied lifetime constraints LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { | ---- lifetime `'new` defined here LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:30:5 @@ -109,7 +109,7 @@ LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) | ---- lifetime `'new` defined here LL | -> OccupiedEntry<'a, &'new (), ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:34:5 @@ -118,7 +118,7 @@ LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) | ---- lifetime `'new` defined here LL | -> OccupiedEntry<'a, (), &'new ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:38:5 @@ -127,7 +127,7 @@ LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) | ---- lifetime `'new` defined here LL | -> OccupiedEntry<'a, &'static (), ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:42:5 @@ -136,7 +136,7 @@ LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) | ---- lifetime `'new` defined here LL | -> OccupiedEntry<'a, (), &'static ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:47:5 @@ -145,7 +145,7 @@ LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) | ---- lifetime `'new` defined here LL | -> VacantEntry<'a, &'new (), ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:51:5 @@ -154,7 +154,7 @@ LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) | ---- lifetime `'new` defined here LL | -> VacantEntry<'a, (), &'new ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:55:5 @@ -163,7 +163,7 @@ LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) | ---- lifetime `'new` defined here LL | -> VacantEntry<'a, &'static (), ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: unsatisfied lifetime constraints --> $DIR/variance-btree-invariant-types.rs:59:5 @@ -172,7 +172,7 @@ LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) | ---- lifetime `'new` defined here LL | -> VacantEntry<'a, (), &'static ()> { LL | v //~ ERROR mismatched types - | ^ return requires that `'new` must outlive `'static` + | ^ returning this value requires that `'new` must outlive `'static` error: aborting due to 12 previous errors diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr index 5189945982d9f..643b8587bea94 100644 --- a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr @@ -13,7 +13,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) | lifetime `'min` defined here ... LL | v //~ ERROR mismatched types - | ^ return requires that `'min` must outlive `'max` + | ^ returning this value requires that `'min` must outlive `'max` error: aborting due to previous error diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr index 8c47513a58706..f0c9c44794df2 100644 --- a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr @@ -13,7 +13,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) | lifetime `'min` defined here ... LL | v //~ ERROR mismatched types - | ^ return requires that `'min` must outlive `'max` + | ^ returning this value requires that `'min` must outlive `'max` error: aborting due to previous error diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr index 6553efdbd62cf..8b6d6100af48e 100644 --- a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr @@ -19,7 +19,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) | lifetime `'min` defined here ... LL | v //~ ERROR mismatched types - | ^ return requires that `'min` must outlive `'max` + | ^ returning this value requires that `'min` must outlive `'max` error: unsatisfied lifetime constraints --> $DIR/variance-use-invariant-struct-1.rs:29:5 @@ -30,7 +30,7 @@ LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) | lifetime `'min` defined here ... LL | v //~ ERROR mismatched types - | ^ return requires that `'min` must outlive `'max` + | ^ returning this value requires that `'min` must outlive `'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/wf/wf-static-method.nll.stderr b/src/test/ui/wf/wf-static-method.nll.stderr index 77896ff2ece74..e563a4ffc5689 100644 --- a/src/test/ui/wf/wf-static-method.nll.stderr +++ b/src/test/ui/wf/wf-static-method.nll.stderr @@ -37,7 +37,7 @@ LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { | lifetime `'a` defined here ... LL | u //~ ERROR E0312 - | ^ return requires that `'b` must outlive `'a` + | ^ returning this value requires that `'b` must outlive `'a` error: unsatisfied lifetime constraints --> $DIR/wf-static-method.rs:43:9 @@ -48,7 +48,7 @@ LL | impl<'a, 'b> Evil<'a, 'b> { | lifetime `'a` defined here LL | fn inherent_evil(u: &'b u32) -> &'a u32 { LL | u //~ ERROR E0312 - | ^ return requires that `'b` must outlive `'a` + | ^ returning this value requires that `'b` must outlive `'a` error: aborting due to 2 previous errors