From cba0761e5f3677b90390fe7aee1eeda684296658 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sun, 27 Oct 2019 09:39:14 -0500 Subject: [PATCH] update tests --- .../implied-region-constraints.nll.stderr | 4 +++ ...es-project-from-hrtb-in-fn-body.nll.stderr | 6 ++++ .../associated-types-subtyping-1.nll.stderr | 4 +++ ...fn-ret-contravariant.krisskross.nll.stderr | 6 ++++ ...-fn-ret-contravariant.transmute.nll.stderr | 2 ++ ...ect-fn-ret-invariant.krisskross.nll.stderr | 6 ++++ ...project-fn-ret-invariant.oneuse.nll.stderr | 6 ++++ ...ject-fn-ret-invariant.transmute.nll.stderr | 2 ++ .../ret-impl-trait-one.nll.stderr | 2 ++ ...orrow-from-shorter-lived-andmut.nll.stderr | 2 ++ .../expect-region-supply-region.nll.stderr | 2 ++ ...ubtype.free_inv_x_vs_free_inv_y.nll.stderr | 4 +++ .../hr-subtype.free_x_vs_free_y.nll.stderr | 2 ++ .../hrtb/hrtb-perfect-forwarding.nll.stderr | 2 ++ .../dyn-trait.nll.stderr | 2 ++ .../multiple-lifetimes/error-handling.stderr | 1 + ...t_outlive_least_region_or_bound.nll.stderr | 4 +++ .../static-return-lifetime-infered.nll.stderr | 1 + .../in-band-lifetimes/mismatched.nll.stderr | 2 ++ src/test/ui/issues/issue-10291.nll.stderr | 2 ++ src/test/ui/issues/issue-26217.nll.stderr | 2 ++ src/test/ui/issues/issue-28848.nll.stderr | 2 ++ src/test/ui/issues/issue-52213.nll.stderr | 2 ++ src/test/ui/issues/issue-54943.nll.stderr | 2 ++ src/test/ui/issues/issue-55796.nll.stderr | 4 +++ ...etime-bound-will-change-warning.nll.stderr | 4 +++ .../ex2c-push-inference-variable.nll.stderr | 2 ++ .../ex2d-push-inference-variable-2.nll.stderr | 2 ++ .../ex2e-push-inference-variable-3.nll.stderr | 2 ++ ...-are-structs-earlybound-regions.nll.stderr | 2 ++ ...h-are-structs-latebound-regions.nll.stderr | 2 ++ ...-anon-regions-latebound-regions.nll.stderr | 2 ++ src/test/ui/lub-if.nll.stderr | 4 +++ src/test/ui/lub-match.nll.stderr | 4 +++ .../match/match-ref-mut-invariance.nll.stderr | 2 ++ .../match-ref-mut-let-invariance.nll.stderr | 2 ++ .../propagate-approximated-ref.stderr | 4 +-- ...oximated-shorter-to-static-no-bound.stderr | 4 +-- ...mated-shorter-to-static-wrong-bound.stderr | 4 +-- .../propagate-approximated-val.stderr | 4 +-- ...n-lbr-named-does-not-outlive-static.stderr | 4 +-- .../region-lbr1-does-not-outlive-ebr2.stderr | 4 +-- src/test/ui/nll/issue-50716.nll.stderr | 2 ++ src/test/ui/nll/issue-52113.stderr | 4 +-- src/test/ui/nll/issue-55401.nll.stderr | 2 ++ src/test/ui/nll/issue-58299.stderr | 8 ++--- src/test/ui/nll/mir_check_cast_closure.stderr | 4 +-- src/test/ui/nll/mir_check_cast_reify.stderr | 4 +-- .../ui/nll/mir_check_cast_unsafe_fn.stderr | 4 +-- src/test/ui/nll/mir_check_cast_unsize.stderr | 4 +-- .../ui/nll/outlives-suggestion-simple.stderr | 32 +++++++------------ .../projection-one-region-closure.stderr | 8 ++--- ...tion-one-region-trait-bound-closure.stderr | 8 ++--- ...tion-two-region-trait-bound-closure.stderr | 4 +-- .../ui/nll/ty-outlives/wf-unreachable.stderr | 32 +++++-------------- .../nll/type-check-pointer-coercions.stderr | 32 +++++++------------ .../nll/type-check-pointer-comparisons.stderr | 24 ++++++++------ .../user-annotations/closure-substs.stderr | 8 ++--- .../constant-in-expr-inherent-1.nll.stderr | 2 ++ .../constant-in-expr-normalize.nll.stderr | 2 ++ .../constant-in-expr-trait-item-1.nll.stderr | 2 ++ .../constant-in-expr-trait-item-2.nll.stderr | 2 ++ .../constant-in-expr-trait-item-3.nll.stderr | 2 ++ .../inherent-associated-constants.stderr | 4 +-- .../nll/user-annotations/issue-54124.stderr | 4 +-- ...-55748-pat-types-constrain-bindings.stderr | 12 ++----- .../issue-57731-ascibed-coupled-types.stderr | 16 +++------- .../ui/nll/user-annotations/patterns.stderr | 16 +++------- .../nll/user-annotations/wf-self-type.stderr | 4 +-- .../ui/nll/where_clauses_in_functions.stderr | 4 +-- .../ui/nll/where_clauses_in_structs.stderr | 4 +-- ...object-lifetime-default-elision.nll.stderr | 2 ++ ...ime-default-from-rptr-box-error.nll.stderr | 2 ++ ...-default-from-rptr-struct-error.nll.stderr | 2 ++ .../object-lifetime-default-mybox.nll.stderr | 4 +++ ...nvariant-static-error-reporting.nll.stderr | 2 ++ .../region-object-lifetime-2.nll.stderr | 2 ++ .../region-object-lifetime-4.nll.stderr | 2 ++ ...ion-object-lifetime-in-coercion.nll.stderr | 2 ++ ...rait-outlives-container.migrate.nll.stderr | 2 ++ ...n-supertrait-outlives-container.nll.stderr | 4 +-- ...unded-by-trait-requiring-static.nll.stderr | 12 +++++++ ...hod-type-parameters-cross-crate.nll.stderr | 2 ++ ...hod-type-parameters-trait-bound.nll.stderr | 2 ++ ...-bounded-method-type-parameters.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 ++ ...se-over-type-parameter-multiple.nll.stderr | 2 ++ .../regions-creating-enums3.nll.stderr | 2 ++ .../regions-creating-enums4.nll.stderr | 2 ++ ...egions-early-bound-error-method.nll.stderr | 2 ++ .../regions-early-bound-error.nll.stderr | 2 ++ ...ons-free-region-ordering-callee.nll.stderr | 4 +++ ...-region-ordering-caller.migrate.nll.stderr | 6 ++++ ...ons-free-region-ordering-caller.nll.stderr | 12 ++----- ...-free-region-ordering-incorrect.nll.stderr | 2 ++ ...nfer-contravariance-due-to-decl.nll.stderr | 2 ++ ...ns-infer-covariance-due-to-decl.nll.stderr | 2 ++ ...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 | 8 +++++ .../ui/regions/regions-nested-fns.nll.stderr | 2 ++ ...ojection-container-hrtb.migrate.nll.stderr | 4 +++ ...lives-projection-container-hrtb.nll.stderr | 8 ++--- ...projection-container-wc.migrate.nll.stderr | 2 ++ ...utlives-projection-container-wc.nll.stderr | 4 +-- ...s-outlives-projection-container.nll.stderr | 8 +++++ ...ow-from-shorter-mut-ref-mut-ref.nll.stderr | 2 ++ ...s-reborrow-from-shorter-mut-ref.nll.stderr | 2 ++ .../regions-static-bound.migrate.nll.stderr | 2 ++ .../regions/regions-static-bound.nll.stderr | 4 +-- .../regions-trait-object-subtyping.nll.stderr | 4 +++ ...se-covariant-in-second-position.nll.stderr | 2 ++ ...nce-contravariant-use-covariant.nll.stderr | 2 ++ ...nce-covariant-use-contravariant.nll.stderr | 2 ++ ...nce-invariant-use-contravariant.nll.stderr | 2 ++ ...ariance-invariant-use-covariant.nll.stderr | 2 ++ .../variance-btree-invariant-types.nll.stderr | 24 ++++++++++++++ .../variance-cell-is-invariant.nll.stderr | 2 ++ ...riance-contravariant-arg-object.nll.stderr | 4 +++ ...e-contravariant-arg-trait-match.nll.stderr | 4 +++ ...-contravariant-self-trait-match.nll.stderr | 4 +++ .../variance-covariant-arg-object.nll.stderr | 4 +++ ...iance-covariant-arg-trait-match.nll.stderr | 4 +++ ...ance-covariant-self-trait-match.nll.stderr | 4 +++ .../variance-invariant-arg-object.nll.stderr | 4 +++ ...iance-invariant-arg-trait-match.nll.stderr | 4 +++ ...ance-invariant-self-trait-match.nll.stderr | 4 +++ ...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 | 12 +++++++ 134 files changed, 409 insertions(+), 207 deletions(-) diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr index 32d099fce759e..b8c54b13d8b4d 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr @@ -8,6 +8,8 @@ LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) ... LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; | ^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/implied-region-constraints.rs:40:64 @@ -19,6 +21,8 @@ LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) ... LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x; | ^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr index ca99304f9b4a0..e12d42e5ed0cc 100644 --- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr +++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr @@ -8,6 +8,8 @@ LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( ... LL | let z: I::A = if cond { x } else { y }; | ^ assignment requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40 @@ -19,6 +21,10 @@ LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( ... LL | let z: I::A = if cond { x } else { y }; | ^ assignment requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr index d8506b9c8c81c..11d3cfe5b4669 100644 --- a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr +++ b/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr @@ -8,6 +8,8 @@ LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T) ... LL | let a: >::Type = make_any(); | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/associated-types-subtyping-1.rs:35:13 @@ -19,6 +21,8 @@ LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T) ... LL | let _c: >::Type = b; | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 2 previous errors 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 779e6dac92e25..a5b6d64039147 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 @@ -8,6 +8,8 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { ... LL | (a, b) | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/project-fn-ret-contravariant.rs:45:4 @@ -19,6 +21,10 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { ... LL | (a, b) | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other 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 f532c96ed2cc7..558f394ef8644 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 @@ -5,6 +5,8 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | bar(foo, x) | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'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 c45082fb0538f..71a533a36f418 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 @@ -8,6 +8,8 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { ... LL | (a, b) | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/project-fn-ret-invariant.rs:55:4 @@ -19,6 +21,10 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { ... LL | (a, b) | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr index 2c11e7ffe930d..c39030fbed1e1 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr @@ -8,6 +8,8 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { LL | let f = foo; // <-- No consistent type can be inferred for `f` here. LL | let a = bar(f, x); | ^^^^^^^^^ argument requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/project-fn-ret-invariant.rs:39:12 @@ -19,6 +21,10 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { ... LL | let b = bar(f, y); | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other 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 8be0ad6e88f3a..f74d4ba73bf4e 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 @@ -6,6 +6,8 @@ LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { ... LL | bar(foo, x) | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr index b4d5d3ec051e2..53b0dd691b891 100644 --- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr +++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr @@ -10,6 +10,8 @@ LL | | LL | | (a, b) LL | | } | |_^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error 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 e6d0f88e3ea8b..f28c42ce2d58f 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 @@ -7,6 +7,8 @@ LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { | lifetime `'a` defined here LL | S { pointer: &mut *p.pointer } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr index bbf75302d564a..f816f27a89236 100644 --- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr +++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr @@ -37,6 +37,8 @@ LL | fn expect_bound_supply_named<'x>() { ... LL | closure_expecting_bound(|x: &'x u32| { | ^ requires that `'x` must outlive `'static` + | + = help: consider replacing `'x` with `'static` error: aborting due to 4 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr index 070fe12a2849f..9b0c987c0545d 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr @@ -11,6 +11,8 @@ LL | gimme::<$t2>(None::<$t1>); LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation + | + = help: consider adding the following bound: `'x: 'y` error: lifetime may not live long enough --> $DIR/hr-subtype.rs:39:13 @@ -25,6 +27,8 @@ LL | gimme::<$t1>(None::<$t2>); LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation + | + = help: consider adding the following bound: `'x: 'y` error: aborting due to 2 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr index e140eaadd48a5..48558fad0051e 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr @@ -11,6 +11,8 @@ LL | gimme::<$t1>(None::<$t2>); LL | / check! { free_x_vs_free_y: (fn(&'x u32), LL | | fn(&'y u32)) } | |__________________________________________- in this macro invocation + | + = help: consider adding the following bound: `'x: 'y` error: aborting due to previous error diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr index 6d1ef24b2dccd..f1647d3d2e43b 100644 --- a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr +++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr @@ -58,6 +58,8 @@ LL | fn foo_hrtb_bar_not<'b,T>(mut t: T) ... LL | foo_hrtb_bar_not(&mut t); | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` + | + = help: consider replacing `'b` with `'static` warning: function cannot return without recursing --> $DIR/hrtb-perfect-forwarding.rs:49:1 diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr index da30997a23111..8e660d6814c43 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr @@ -5,6 +5,8 @@ LL | fn with_dyn_debug_static<'a>(x: Box) { | - `x` is a reference that is only valid in the function body LL | static_val(x); | ^^^^^^^^^^^^^ `x` escapes the function body here + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr index 82e280b9fb2e1..45c5142d93f28 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr @@ -4,6 +4,7 @@ error: lifetime may not live long enough LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { | -- lifetime `'a` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'static` | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | type E<'a, 'b> = impl Sized; + 'a 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 097f003575eab..bb5a85aba9709 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 @@ -19,6 +19,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } | | | lifetime `'a` defined here | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x } @@ -31,6 +32,7 @@ LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` | = help: consider replacing `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:17:61 @@ -39,6 +41,8 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32 | -- -- lifetime `'b` defined here ^^^^^^^^^^^^^^^^ opaque type requires that `'b` must outlive `'a` | | | lifetime `'a` defined here + | + = help: consider adding the following bound: `'b: 'a` error[E0310]: the parameter type `T` may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:22:51 diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr index 423cfcc498980..22f081b79f157 100644 --- a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr +++ b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr @@ -19,6 +19,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator { | | | lifetime `'a` defined here | + = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint | LL | fn iter_values<'a>(&'a self) -> impl Iterator + 'a { diff --git a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr index f5aee2d2d7e5c..db028e63a8244 100644 --- a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr @@ -14,6 +14,8 @@ LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } | | | | | lifetime `'b` defined here | lifetime `'a` defined here + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-10291.nll.stderr b/src/test/ui/issues/issue-10291.nll.stderr index a7b827d27a87b..1ebb0c6cf1e7b 100644 --- a/src/test/ui/issues/issue-10291.nll.stderr +++ b/src/test/ui/issues/issue-10291.nll.stderr @@ -6,6 +6,8 @@ LL | fn test<'x>(x: &'x isize) { LL | drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { LL | x | ^ returning this value requires that `'x` must outlive `'static` + | + = help: consider replacing `'x` with `'static` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-26217.nll.stderr b/src/test/ui/issues/issue-26217.nll.stderr index c7601caacdca3..83f10c67d43a5 100644 --- a/src/test/ui/issues/issue-26217.nll.stderr +++ b/src/test/ui/issues/issue-26217.nll.stderr @@ -5,6 +5,8 @@ LL | fn bar<'a>() { | -- lifetime `'a` defined here LL | foo::<&'a i32>(); | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-28848.nll.stderr b/src/test/ui/issues/issue-28848.nll.stderr index 5cf9856e4dc7e..a29dac4c9c87c 100644 --- a/src/test/ui/issues/issue-28848.nll.stderr +++ b/src/test/ui/issues/issue-28848.nll.stderr @@ -7,6 +7,8 @@ LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { | lifetime `'a` defined here LL | Foo::<'a, 'b>::xmute(u) | ^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-52213.nll.stderr b/src/test/ui/issues/issue-52213.nll.stderr index eba875de2152b..359f91309d4f3 100644 --- a/src/test/ui/issues/issue-52213.nll.stderr +++ b/src/test/ui/issues/issue-52213.nll.stderr @@ -8,6 +8,8 @@ LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { LL | match (&t,) { LL | ((u,),) => u, | ^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-54943.nll.stderr b/src/test/ui/issues/issue-54943.nll.stderr index 59be0f983b907..5bf6d3382d2eb 100644 --- a/src/test/ui/issues/issue-54943.nll.stderr +++ b/src/test/ui/issues/issue-54943.nll.stderr @@ -6,6 +6,8 @@ LL | fn boo<'a>() { ... LL | let x = foo::<&'a u32>(); | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-55796.nll.stderr b/src/test/ui/issues/issue-55796.nll.stderr index 5809a56cd4b6b..baa0e6c29bfc4 100644 --- a/src/test/ui/issues/issue-55796.nll.stderr +++ b/src/test/ui/issues/issue-55796.nll.stderr @@ -6,6 +6,8 @@ LL | pub trait Graph<'a> { ... LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-55796.rs:21:9 @@ -15,6 +17,8 @@ LL | pub trait Graph<'a> { ... LL | Box::new(self.in_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr index f2cf19abdac31..60420973e1ee0 100644 --- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr @@ -6,6 +6,8 @@ LL | fn test2<'a>(x: &'a Box) { LL | // but ref_obj will not, so warn. LL | ref_obj(x) | ^^^^^^^^^^ `x` escapes the function body here + | + = help: consider replacing `'a` with `'static` error[E0521]: borrowed data escapes outside of function --> $DIR/lifetime-bound-will-change-warning.rs:39:5 @@ -15,6 +17,8 @@ LL | fn test2cc<'a>(x: &'a Box) { LL | // same as test2, but cross crate LL | lib::ref_obj(x) | ^^^^^^^^^^^^^^^ `x` escapes the function body here + | + = help: consider replacing `'a` with `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr index fbefa1f5667c7..99fab4631a216 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr @@ -8,6 +8,8 @@ LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { LL | let z = Ref { data: y.data }; LL | x.push(z); | ^^^^^^^^^ argument requires that `'c` must outlive `'b` + | + = help: consider adding the following bound: `'c: 'b` error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr index d889eb4afdbe5..52c5752f6ea1e 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr @@ -8,6 +8,8 @@ LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { ... LL | a.push(b); | ^^^^^^^^^ argument requires that `'c` must outlive `'b` + | + = help: consider adding the following bound: `'c: 'b` error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr index 39eb4079352c3..e90c81ee3e1af 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr @@ -8,6 +8,8 @@ LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { ... LL | Vec::push(a, b); | ^^^^^^^^^^^^^^^ argument requires that `'c` must outlive `'b` + | + = help: consider adding the following bound: `'c: 'b` error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr index a39bb165806f2..b3d0bc2b882f9 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr @@ -8,6 +8,8 @@ LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) ... LL | x.push(y); | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr index 48ce5301adef3..fbe98a4263ec1 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr @@ -7,6 +7,8 @@ LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) { | lifetime `'a` defined here LL | x.push(y); | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr index 0996068398009..1e24032fc1ce2 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr @@ -7,6 +7,8 @@ LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) { | lifetime `'a` defined here LL | x.push(y); | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/lub-if.nll.stderr b/src/test/ui/lub-if.nll.stderr index 832688f5162b3..1ef479fcd4bc0 100644 --- a/src/test/ui/lub-if.nll.stderr +++ b/src/test/ui/lub-if.nll.stderr @@ -6,6 +6,8 @@ LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { ... LL | s | ^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/lub-if.rs:35:9 @@ -15,6 +17,8 @@ LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { ... LL | s | ^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'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 3a344a77d2c2d..ed551da54f55e 100644 --- a/src/test/ui/lub-match.nll.stderr +++ b/src/test/ui/lub-match.nll.stderr @@ -6,6 +6,8 @@ LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { ... LL | s | ^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/lub-match.rs:39:13 @@ -15,6 +17,8 @@ LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { ... LL | s | ^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'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 505b8db6a3332..1658efa28bf30 100644 --- a/src/test/ui/match/match-ref-mut-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.nll.stderr @@ -7,6 +7,8 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { | -- lifetime `'a` defined here LL | match self.0 { ref mut x => x } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: '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 ab5f43d022281..dc227a36566e6 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 @@ -8,6 +8,8 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { LL | let ref mut x = self.0; LL | x | ^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error 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 61f20d1dc9ad0..d383dcca9c127 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -42,10 +42,8 @@ LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { ... LL | demand_y(x, y, x.get()) | ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index e34884e9f9a36..20b9144341c2e 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -45,10 +45,8 @@ LL | | // Only works if 'x: 'y: LL | | demand_y(x, y, x.get()) LL | | }); | |______^ `cell_a` escapes the function body here - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 40917135c59d3..7fe00271fc4d2 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -45,10 +45,8 @@ LL | | // Only works if 'x: 'y: LL | | demand_y(x, y, x.get()) LL | | }); | |______^ `cell_a` escapes the function body here - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to previous error 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 f227e9eb413e5..7678f24381ec4 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -42,10 +42,8 @@ LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { ... LL | demand_y(outlives1, outlives2, x.get()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` 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 5e8d9fa7882f1..1fa3d01017af5 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 @@ -5,10 +5,8 @@ LL | fn foo<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | &*x | ^^^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'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 d3edbfdae88fd..d0ba539253248 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 @@ -7,10 +7,8 @@ LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 { | lifetime `'a` defined here LL | &*x | ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/nll/issue-50716.nll.stderr b/src/test/ui/nll/issue-50716.nll.stderr index 38dd1b5f6fe73..7b83e4beaf387 100644 --- a/src/test/ui/nll/issue-50716.nll.stderr +++ b/src/test/ui/nll/issue-50716.nll.stderr @@ -6,6 +6,8 @@ LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) ... LL | let _x = *s; | ^^ proving this value is `Sized` requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/issue-52113.stderr b/src/test/ui/nll/issue-52113.stderr index 109c7e9565911..dcf0338673483 100644 --- a/src/test/ui/nll/issue-52113.stderr +++ b/src/test/ui/nll/issue-52113.stderr @@ -8,10 +8,8 @@ LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> i ... LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/nll/issue-55401.nll.stderr b/src/test/ui/nll/issue-55401.nll.stderr index 4f797f26a1a7c..df320aa0844ad 100644 --- a/src/test/ui/nll/issue-55401.nll.stderr +++ b/src/test/ui/nll/issue-55401.nll.stderr @@ -6,6 +6,8 @@ LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u LL | let (ref y, _z): (&'a u32, u32) = (&22, 44); LL | *y | ^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/issue-58299.stderr b/src/test/ui/nll/issue-58299.stderr index 906a7bff00d4e..5be4e56171c52 100644 --- a/src/test/ui/nll/issue-58299.stderr +++ b/src/test/ui/nll/issue-58299.stderr @@ -6,10 +6,8 @@ LL | fn foo<'a>(x: i32) { ... LL | A::<'a>::X..=A::<'static>::X => (), | ^^^^^^^^^^ requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-58299.rs:24:27 @@ -19,10 +17,8 @@ LL | fn bar<'a>(x: i32) { ... LL | A::<'static>::X..=A::<'a>::X => (), | ^^^^^^^^^^ requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/mir_check_cast_closure.stderr b/src/test/ui/nll/mir_check_cast_closure.stderr index 40ce9e850ea43..113e220e5137e 100644 --- a/src/test/ui/nll/mir_check_cast_closure.stderr +++ b/src/test/ui/nll/mir_check_cast_closure.stderr @@ -8,10 +8,8 @@ LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 { LL | let g: fn(_, _) -> _ = |_x, y| y; LL | g | ^ returning this value requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: '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 f091161b22407..1722da8f343de 100644 --- a/src/test/ui/nll/mir_check_cast_reify.stderr +++ b/src/test/ui/nll/mir_check_cast_reify.stderr @@ -6,10 +6,8 @@ LL | fn bar<'a>(x: &'a u32) -> &'static u32 { ... LL | f(x) | ^^^^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'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 2f76758f259a5..c87425ecfc0fa 100644 --- a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr +++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr @@ -6,10 +6,8 @@ LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 { ... LL | unsafe { g(input) } | ^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'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 4a76fa8158e5a..cb7328d117984 100644 --- a/src/test/ui/nll/mir_check_cast_unsize.stderr +++ b/src/test/ui/nll/mir_check_cast_unsize.stderr @@ -5,10 +5,8 @@ LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug { | -- lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/outlives-suggestion-simple.stderr b/src/test/ui/nll/outlives-suggestion-simple.stderr index 90c6bf2f5b8d9..f7603e29d488c 100644 --- a/src/test/ui/nll/outlives-suggestion-simple.stderr +++ b/src/test/ui/nll/outlives-suggestion-simple.stderr @@ -7,10 +7,8 @@ LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize { | lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:10:5 @@ -19,10 +17,8 @@ LL | fn foo2<'a>(x: &'a usize) -> &'static usize { | -- lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:14:5 @@ -33,6 +29,8 @@ LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) { | lifetime `'a` defined here LL | (x, y) | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:14:5 @@ -43,10 +41,10 @@ LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) { | lifetime `'a` defined here LL | (x, y) | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` - -help: the following changes may resolve your lifetime errors | - = help: `'a` and `'b` must be the same; replace one with the other + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:22:5 @@ -58,10 +56,8 @@ LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) { ... LL | (x, x) | ^^^^^^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:31:9 @@ -70,10 +66,8 @@ LL | pub fn foo<'a>(x: &'a usize) -> Self { | -- lifetime `'a` defined here LL | Foo { x } | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:41:9 @@ -84,10 +78,8 @@ LL | pub fn get<'b>(&self) -> &'b usize { | -- lifetime `'b` defined here LL | self.x | ^^^^^^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/outlives-suggestion-simple.rs:52:9 @@ -98,10 +90,8 @@ LL | fn get<'b>(&'b self) -> &'a i32 { | -- lifetime `'b` defined here LL | self.x | ^^^^^^ returning this value requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error[E0521]: borrowed data escapes outside of function --> $DIR/outlives-suggestion-simple.rs:73:9 diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index be45c23ed8318..7c5a6eecea1ea 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -50,10 +50,8 @@ LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) ... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` note: External requirements --> $DIR/projection-one-region-closure.rs:56:29 @@ -108,10 +106,8 @@ LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) ... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` note: External requirements --> $DIR/projection-one-region-closure.rs:70:29 diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index 39f9e78f88964..a2ba2e36edf42 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -41,10 +41,8 @@ LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) ... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` note: External requirements --> $DIR/projection-one-region-trait-bound-closure.rs:47:29 @@ -90,10 +88,8 @@ LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) ... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` note: External requirements --> $DIR/projection-one-region-trait-bound-closure.rs:60:29 diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index 15e921bdec16c..109edfec43c0e 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -236,10 +236,8 @@ LL | fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T) ... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` note: External requirements --> $DIR/projection-two-region-trait-bound-closure.rs:97:29 diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr index e4fa647e6cb1a..f15c2ffd0d7eb 100644 --- a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr +++ b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr @@ -6,10 +6,8 @@ LL | fn uninit<'a>() { LL | return; LL | let x: &'static &'a (); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:13:12 @@ -19,10 +17,8 @@ LL | fn var_type<'a>() { LL | return; LL | let x: &'static &'a () = &&(); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:17:12 @@ -31,10 +27,8 @@ LL | fn uninit_infer<'a>() { | -- lifetime `'a` defined here LL | let x: &'static &'a _; | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:23:12 @@ -44,10 +38,8 @@ LL | fn infer<'a>() { LL | return; LL | let x: &'static &'a _ = &&(); | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:28:12 @@ -57,10 +49,8 @@ LL | fn uninit_no_var<'a>() { LL | return; LL | let _: &'static &'a (); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:33:12 @@ -70,10 +60,8 @@ LL | fn no_var<'a>() { LL | return; LL | let _: &'static &'a () = &&(); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:38:12 @@ -83,10 +71,8 @@ LL | fn infer_no_var<'a>() { LL | return; LL | let _: &'static &'a _ = &&(); | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/wf-unreachable.rs:51:12 @@ -96,10 +82,8 @@ LL | fn required_substs<'a>() { LL | return; LL | let _: C<'static, 'a, _> = C((), &(), &()); | ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 8 previous errors diff --git a/src/test/ui/nll/type-check-pointer-coercions.stderr b/src/test/ui/nll/type-check-pointer-coercions.stderr index 9c7601c3a6026..39fd98f7151a0 100644 --- a/src/test/ui/nll/type-check-pointer-coercions.stderr +++ b/src/test/ui/nll/type-check-pointer-coercions.stderr @@ -7,10 +7,8 @@ LL | fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 { | lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:8:5 @@ -21,10 +19,8 @@ LL | fn unique_to_const<'a, 'b>(x: &mut &'a i32) -> *const &'b i32 { | lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:13:5 @@ -36,6 +32,8 @@ LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 { LL | // Two errors because *mut is invariant LL | x | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:13:5 @@ -47,10 +45,10 @@ LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 { LL | // Two errors because *mut is invariant LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: `'b` and `'a` must be the same; replace one with the other + = help: consider adding the following bound: `'a: 'b` + +help: `'b` and `'a` must be the same: replace one with the other error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:18:5 @@ -61,10 +59,8 @@ LL | fn mut_to_const<'a, 'b>(x: *mut &'a i32) -> *const &'b i32 { | lifetime `'a` defined here LL | x | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:24:5 @@ -76,10 +72,8 @@ LL | fn array_elem<'a, 'b>(x: &'a i32) -> *const &'b i32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:30:5 @@ -91,10 +85,8 @@ LL | fn array_coerce<'a, 'b>(x: &'a i32) -> *const [&'b i32; 3] { ... LL | y | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-coercions.rs:36:5 @@ -106,10 +98,8 @@ LL | fn nested_array<'a, 'b>(x: &'a i32) -> *const [&'b i32; 2] { ... LL | y | ^ returning this value requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: aborting due to 8 previous errors diff --git a/src/test/ui/nll/type-check-pointer-comparisons.stderr b/src/test/ui/nll/type-check-pointer-comparisons.stderr index 5293f48116e8f..f350b861eb6d2 100644 --- a/src/test/ui/nll/type-check-pointer-comparisons.stderr +++ b/src/test/ui/nll/type-check-pointer-comparisons.stderr @@ -7,6 +7,8 @@ LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | lifetime `'a` defined here LL | x == y; | ^ requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-comparisons.rs:6:10 @@ -17,10 +19,10 @@ LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | lifetime `'a` defined here LL | x == y; | ^ requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: `'b` and `'a` must be the same; replace one with the other + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough --> $DIR/type-check-pointer-comparisons.rs:12:5 @@ -31,6 +33,8 @@ LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | lifetime `'a` defined here LL | x == y; | ^ requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-comparisons.rs:12:10 @@ -41,10 +45,10 @@ LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | lifetime `'a` defined here LL | x == y; | ^ requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: `'a` and `'b` must be the same; replace one with the other + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough --> $DIR/type-check-pointer-comparisons.rs:18:5 @@ -55,6 +59,8 @@ LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32 | lifetime `'a` defined here LL | f == g; | ^ requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/type-check-pointer-comparisons.rs:18:10 @@ -65,10 +71,10 @@ LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32 | lifetime `'a` defined here LL | f == g; | ^ requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: `'a` and `'b` must be the same; replace one with the other + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: aborting due to 6 previous errors diff --git a/src/test/ui/nll/user-annotations/closure-substs.stderr b/src/test/ui/nll/user-annotations/closure-substs.stderr index ff0cda9114a1a..e3e294106d168 100644 --- a/src/test/ui/nll/user-annotations/closure-substs.stderr +++ b/src/test/ui/nll/user-annotations/closure-substs.stderr @@ -6,10 +6,8 @@ LL | fn foo<'a>() { ... LL | return x; | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/closure-substs.rs:15:16 @@ -27,10 +25,8 @@ LL | fn bar<'a>() { ... LL | b(x); | ^^^^ argument requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error[E0521]: borrowed data escapes outside of closure --> $DIR/closure-substs.rs:29:9 diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr index c39301588acfa..e9a0b8173ceaa 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr @@ -5,6 +5,8 @@ LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | >::C | ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr index 541a2cfaf299a..52ec36ef542cc 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr @@ -5,6 +5,8 @@ LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | <() as Foo<'a>>::C | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr index ea0fcb6d634cd..5f3212eb9aa34 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr @@ -5,6 +5,8 @@ LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | <() as Foo<'a>>::C | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr index ff549f1d88bd4..490030d30f317 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr @@ -5,6 +5,8 @@ LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here LL | >::C | ^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr index 7f160d8e398b9..5e687805c6fc3 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr @@ -5,6 +5,8 @@ LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here LL | T::C | ^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr index 48d56fc1c02fe..7b5646de775ab 100644 --- a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr +++ b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr @@ -5,10 +5,8 @@ LL | fn non_wf_associated_const<'a>(x: i32) { | -- lifetime `'a` defined here LL | A::<'a>::IC; | ^^^^^^^^^^^ requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/issue-54124.stderr b/src/test/ui/nll/user-annotations/issue-54124.stderr index 64df1264d27ea..97653b8c199c8 100644 --- a/src/test/ui/nll/user-annotations/issue-54124.stderr +++ b/src/test/ui/nll/user-annotations/issue-54124.stderr @@ -15,10 +15,8 @@ LL | fn test<'a>() { | -- lifetime `'a` defined here LL | let _:fn(&()) = |_:&'a ()| {}; | ^ requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr index a629cc267635d..f23ea9fdb5c31 100644 --- a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr +++ b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr @@ -6,10 +6,8 @@ LL | fn coupled_regions_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-55748-pat-types-constrain-bindings.rs:49:5 @@ -19,10 +17,8 @@ LL | fn coupled_types_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-55748-pat-types-constrain-bindings.rs:62:5 @@ -32,10 +28,8 @@ LL | fn coupled_wilds_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 3 previous errors diff --git a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.stderr b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.stderr index 937db3775738d..426c57ef9c4e7 100644 --- a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.stderr +++ b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.stderr @@ -6,10 +6,8 @@ LL | fn coupled_wilds_rhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { LL | let ((y, _z),) = ((s, _x),): (PairCoupledTypes<_>,); LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-57731-ascibed-coupled-types.rs:22:5 @@ -19,10 +17,8 @@ LL | fn coupled_regions_rhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { LL | let ((y, _z),) = ((s, _x),): (PairCoupledRegions<_>,); LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-57731-ascibed-coupled-types.rs:32:5 @@ -32,10 +28,8 @@ LL | fn cast_coupled_wilds_rhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 LL | let ((y, _z),) = ((s, _x),) as (PairCoupledTypes<_>,); LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/issue-57731-ascibed-coupled-types.rs:37:5 @@ -45,10 +39,8 @@ LL | fn cast_coupled_regions_rhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u LL | let ((y, _z),) = ((s, _x),) as (PairCoupledRegions<_>,); LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 4 previous errors diff --git a/src/test/ui/nll/user-annotations/patterns.stderr b/src/test/ui/nll/user-annotations/patterns.stderr index 981e59c08c520..c2786f0e8cca2 100644 --- a/src/test/ui/nll/user-annotations/patterns.stderr +++ b/src/test/ui/nll/user-annotations/patterns.stderr @@ -156,10 +156,8 @@ LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/patterns.rs:125:5 @@ -169,10 +167,8 @@ LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 { ... LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/patterns.rs:130:5 @@ -182,10 +178,8 @@ LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 { LL | let Single { value: y }: Single<&'a u32> = Single { value: &22 }; LL | y | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/patterns.rs:134:18 @@ -194,10 +188,8 @@ LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here LL | let (y, _z): (&'static u32, u32) = (x, 44); | ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error: aborting due to 19 previous errors diff --git a/src/test/ui/nll/user-annotations/wf-self-type.stderr b/src/test/ui/nll/user-annotations/wf-self-type.stderr index c3b32865b0147..33bb1c519b16e 100644 --- a/src/test/ui/nll/user-annotations/wf-self-type.stderr +++ b/src/test/ui/nll/user-annotations/wf-self-type.stderr @@ -7,10 +7,8 @@ LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { | lifetime `'a` defined here LL | Foo::xmute(u) | ^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/nll/where_clauses_in_functions.stderr b/src/test/ui/nll/where_clauses_in_functions.stderr index c01101cf1f6d0..1badb7d753b6e 100644 --- a/src/test/ui/nll/where_clauses_in_functions.stderr +++ b/src/test/ui/nll/where_clauses_in_functions.stderr @@ -7,10 +7,8 @@ LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | lifetime `'a` defined here LL | foo(x, y) | ^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/nll/where_clauses_in_structs.stderr b/src/test/ui/nll/where_clauses_in_structs.stderr index aa15aa4ddcae2..2e990131e61de 100644 --- a/src/test/ui/nll/where_clauses_in_structs.stderr +++ b/src/test/ui/nll/where_clauses_in_structs.stderr @@ -7,10 +7,8 @@ LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) { | lifetime `'a` defined here LL | Foo { x, y }; | ^ requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: '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 e94f2a92125cd..900cdfca24438 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 @@ -8,6 +8,8 @@ LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { ... LL | ss | ^^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr index 7d6f9f39d13ed..defffe2b84b0d 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr @@ -5,6 +5,8 @@ LL | fn c<'a>(t: &'a Box, mut ss: SomeStruct<'a>) { | -- lifetime `'a` defined here LL | ss.t = t; | ^^^^^^^^ assignment requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr index 6df54638ce004..8c28a7a011aba 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr @@ -5,6 +5,8 @@ LL | fn c<'a>(t: &'a MyBox, mut ss: SomeStruct<'a>) { | -- lifetime `'a` defined here LL | ss.t = t; | ^^^^^^^^ assignment requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` 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 cdfbf0fc878cf..d871eb5327d22 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 @@ -8,6 +8,8 @@ LL | fn load1<'a,'b>(a: &'a MyBox, ... LL | a | ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error[E0521]: borrowed data escapes outside of function --> $DIR/object-lifetime-default-mybox.rs:31:5 @@ -16,6 +18,8 @@ LL | fn load2<'a>(ss: &MyBox) -> MyBox { | -- `ss` is a reference that is only valid in the function body LL | load0(ss) | ^^^^^^^^^ `ss` escapes the function body here + | + = help: consider replacing `'a` with `'static` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr index 76129b4d188d3..d941030d82474 100644 --- a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr +++ b/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr @@ -6,6 +6,8 @@ LL | fn unify<'a>(x: Option>, f: fn(Invariant<'a>)) { LL | let bad = if x.is_some() { LL | x.unwrap() | ^^^^^^^^^^ `x` escapes the function body here + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error 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 60084773466a6..db45a03ad18fb 100644 --- a/src/test/ui/regions/region-object-lifetime-2.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-2.nll.stderr @@ -7,6 +7,8 @@ LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () { | lifetime `'a` defined here LL | x.borrowed() | ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/regions/region-object-lifetime-4.nll.stderr b/src/test/ui/regions/region-object-lifetime-4.nll.stderr index 75b049dae21f8..fda66a2412ccb 100644 --- a/src/test/ui/regions/region-object-lifetime-4.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-4.nll.stderr @@ -7,6 +7,8 @@ LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &' | lifetime `'a` defined here LL | x.borrowed() | ^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: '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 43acbfd412d91..767853d81480e 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 @@ -32,6 +32,8 @@ LL | fn d<'a,'b>(v: &'a [u8]) -> Box { | lifetime `'a` defined here LL | Box::new(v) | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.nll.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.nll.stderr index 4944f2649b738..9bb385b0dcdc8 100644 --- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.nll.stderr +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.nll.stderr @@ -8,6 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr index 79ea4caa34333..9bb385b0dcdc8 100644 --- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr @@ -8,10 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr index 86bd100538d70..ca153b9d9b1d7 100644 --- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr +++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr @@ -5,6 +5,8 @@ LL | fn param_not_ok<'a>(x: &'a isize) { | -- lifetime `'a` defined here LL | assert_send::<&'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5 @@ -13,6 +15,8 @@ LL | fn param_not_ok1<'a>(_: &'a isize) { | -- lifetime `'a` defined here LL | assert_send::<&'a str>(); | ^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/regions-bounded-by-trait-requiring-static.rs:30:5 @@ -21,6 +25,8 @@ LL | fn param_not_ok2<'a>(_: &'a isize) { | -- lifetime `'a` defined here LL | assert_send::<&'a [isize]>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/regions-bounded-by-trait-requiring-static.rs:44:5 @@ -29,6 +35,8 @@ LL | fn box_with_region_not_ok<'a>() { | -- lifetime `'a` defined here LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/regions-bounded-by-trait-requiring-static.rs:55:5 @@ -37,6 +45,8 @@ LL | fn unsafe_ok2<'a>(_: &'a isize) { | -- lifetime `'a` defined here LL | assert_send::<*const &'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: lifetime may not live long enough --> $DIR/regions-bounded-by-trait-requiring-static.rs:59:5 @@ -45,6 +55,8 @@ LL | fn unsafe_ok3<'a>(_: &'a isize) { | -- lifetime `'a` defined here LL | assert_send::<*mut &'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to 6 previous errors diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr index a8ab92d75c06d..47796e50a888f 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr @@ -8,6 +8,8 @@ LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { LL | // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. LL | a.bigger_region(b) | ^^^^^^^^^^^^^^^^^^ argument requires that `'y` must outlive `'x` + | + = help: consider adding the following bound: `'y: 'x` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr index 52ad2d9daeb1d..d352d119a70e8 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr @@ -8,6 +8,8 @@ LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { LL | // Here the value provided for 'y is 'b, and hence 'b:'a does not hold. LL | f.method(b); | ^^^^^^^^^^^ `b` escapes the function body here + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr index b6d7b8aac5f19..2076772b59df4 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr @@ -5,6 +5,8 @@ LL | fn caller<'a>(x: &isize) { | -- lifetime `'a` defined here LL | Foo.some_method::<&'a isize>(); | ^^^^^^^^^^^ requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-bounds.nll.stderr b/src/test/ui/regions/regions-bounds.nll.stderr index 3345946bfddff..dd702755c7e7b 100644 --- a/src/test/ui/regions/regions-bounds.nll.stderr +++ b/src/test/ui/regions/regions-bounds.nll.stderr @@ -7,6 +7,8 @@ LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> { | lifetime `'a` defined here LL | return e; | ^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-bounds.rs:13:12 @@ -17,6 +19,8 @@ LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> { | lifetime `'a` defined here LL | return e; | ^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: '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 806a3ca82425b..882faf4ece316 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 @@ -5,6 +5,8 @@ LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { | -- lifetime `'a` defined here LL | box B(&*v) as Box | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error[E0515]: cannot return value referencing local data `*v` --> $DIR/regions-close-object-into-object-2.rs:10:5 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 1e57023bc2320..93ac17810dae2 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 @@ -13,6 +13,8 @@ LL | fn i<'a, T, U>(v: Box+'a>) -> Box { | -- lifetime `'a` defined here LL | box B(&*v) as Box | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error[E0515]: cannot return value referencing local data `*v` --> $DIR/regions-close-object-into-object-4.rs:10:5 diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr index 88d6abd1428aa..2fb9dcc4e9ec7 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr @@ -8,6 +8,8 @@ LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'c` + | + = help: consider adding the following bound: `'a: 'c` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-creating-enums3.nll.stderr b/src/test/ui/regions/regions-creating-enums3.nll.stderr index e35a878fce177..41d609b56d233 100644 --- a/src/test/ui/regions/regions-creating-enums3.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums3.nll.stderr @@ -7,6 +7,8 @@ LL | fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> { | lifetime `'a` defined here LL | Ast::Add(x, y) | ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` 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 4eac457feda2c..dda374c90d937 100644 --- a/src/test/ui/regions/regions-creating-enums4.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums4.nll.stderr @@ -7,6 +7,8 @@ LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { | lifetime `'a` defined here LL | Ast::Add(x, y) | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: '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 1540a7bacd7b2..4957bcf3f7371 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 @@ -7,6 +7,8 @@ LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { | -- lifetime `'b` defined here LL | g2.get() | ^^^^^^^^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: '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 7836291a7caab..eb4cd5ca72ea1 100644 --- a/src/test/ui/regions/regions-early-bound-error.nll.stderr +++ b/src/test/ui/regions/regions-early-bound-error.nll.stderr @@ -7,6 +7,8 @@ LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { | lifetime `'a` defined here LL | g1.get() | ^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error 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 9ae484eaf4558..f61f068a4861b 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 @@ -8,6 +8,8 @@ LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { LL | // However, it is not safe to assume that 'b <= 'a LL | &*y | ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-free-region-ordering-callee.rs:18:12 @@ -19,6 +21,8 @@ LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { LL | // Do not infer an ordering from the return value. LL | let z: &'b usize = &*x; | ^^^^^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.migrate.nll.stderr index 16eda2844c64c..0d4694a64d087 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-caller.migrate.nll.stderr @@ -7,6 +7,8 @@ LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { | lifetime `'a` defined here LL | let z: Option<&'b &'a usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-free-region-ordering-caller.rs:17:12 @@ -18,6 +20,8 @@ LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { LL | let y: Paramd<'a> = Paramd { x: a }; LL | let z: Option<&'b Paramd<'a>> = None; | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-free-region-ordering-caller.rs:22:12 @@ -28,6 +32,8 @@ LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { | lifetime `'a` defined here LL | let z: Option<&'a &'b usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr index 594ea755e3d43..0d4694a64d087 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr @@ -7,10 +7,8 @@ LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { | lifetime `'a` defined here LL | let z: Option<&'b &'a usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-free-region-ordering-caller.rs:17:12 @@ -22,10 +20,8 @@ LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { LL | let y: Paramd<'a> = Paramd { x: a }; LL | let z: Option<&'b Paramd<'a>> = None; | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'a: 'b` + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-free-region-ordering-caller.rs:22:12 @@ -36,10 +32,8 @@ LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { | lifetime `'a` defined here LL | let z: Option<&'a &'b usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: aborting due to 3 previous errors 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 480a81d33f64c..106d3df274435 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 @@ -10,6 +10,8 @@ LL | | Some(ref next) => next.get(), LL | | None => &self.val LL | | } | |_________^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr index cefeecf16e2d4..94b80852d0124 100644 --- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Contravariant<'short>, ... LL | let _: Contravariant<'long> = c; | ^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr index 1bddecba50a72..f44a0fad59b2e 100644 --- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Covariant<'long>, ... LL | let _: Covariant<'short> = c; | ^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` 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 0c1e3989b234a..3256e3c0dd381 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 @@ -5,6 +5,8 @@ LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here LL | b_isize | ^^^^^^^ returning this value requires that `'r` must outlive `'static` + | + = help: consider replacing `'r` with `'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 0edeb2723998f..991f9a287b9bf 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 @@ -5,6 +5,8 @@ LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here LL | b_isize | ^^^^^^^ returning this value requires that `'r` must outlive `'static` + | + = help: consider replacing `'r` with `'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 724dd7e3f6d3f..2d62fb85b81eb 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 @@ -5,6 +5,8 @@ LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here LL | b_isize | ^^^^^^^ returning this value requires that `'r` must outlive `'static` + | + = help: consider replacing `'r` with `'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 2064b060ec419..fcc2ec31f3e02 100644 --- a/src/test/ui/regions/regions-infer-not-param.nll.stderr +++ b/src/test/ui/regions/regions-infer-not-param.nll.stderr @@ -5,6 +5,8 @@ LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b` | | | lifetime `'a` defined here + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-infer-not-param.rs:19:63 @@ -13,6 +15,8 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | -- -- 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 + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-infer-not-param.rs:19:63 @@ -21,6 +25,10 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b` | | | lifetime `'a` defined here + | + = help: consider adding the following bound: `'a: 'b` + +help: `'b` and `'a` must be the same: replace one with the other error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-nested-fns.nll.stderr b/src/test/ui/regions/regions-nested-fns.nll.stderr index 97650636cb67f..305a76815aca9 100644 --- a/src/test/ui/regions/regions-nested-fns.nll.stderr +++ b/src/test/ui/regions/regions-nested-fns.nll.stderr @@ -45,6 +45,8 @@ LL | fn nested<'x>(x: &'x isize) { ... LL | if false { return x; } | ^ returning this value requires that `'x` must outlive `'static` + | + = help: consider replacing `'x` with `'static` error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr index eed9934be121d..29e92f33ec914 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr @@ -8,6 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithHrAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-outlives-projection-container-hrtb.rs:50:12 @@ -19,6 +21,8 @@ LL | fn with_assoc_sub<'a,'b>() { ... LL | let _: &'a WithHrAssocSub> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr index fb836d32a2bff..29e92f33ec914 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr @@ -8,10 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithHrAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-outlives-projection-container-hrtb.rs:50:12 @@ -23,10 +21,8 @@ LL | fn with_assoc_sub<'a,'b>() { ... LL | let _: &'a WithHrAssocSub> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr index 8c54d8da0a063..7035144302479 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr @@ -8,6 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr index 3f5088c12d64a..7035144302479 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr @@ -8,10 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _: &'a WithAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` - -help: the following changes may resolve your lifetime errors | - = help: add bound `'b: 'a` + = help: consider adding the following bound: `'b: 'a` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container.nll.stderr index 2cf6e245d19f6..073a31900227e 100644 --- a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container.nll.stderr @@ -8,6 +8,8 @@ LL | fn with_assoc<'a,'b>() { ... LL | let _x: &'a WithAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-outlives-projection-container.rs:54:13 @@ -19,6 +21,8 @@ LL | fn without_assoc<'a,'b>() { ... LL | let _x: &'a WithoutAssoc> = loop { }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-outlives-projection-container.rs:63:5 @@ -30,6 +34,8 @@ LL | fn call_with_assoc<'a,'b>() { ... LL | call::<&'a WithAssoc>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/regions-outlives-projection-container.rs:70:5 @@ -41,6 +47,8 @@ LL | fn call_without_assoc<'a,'b>() { ... LL | call::<&'a WithoutAssoc>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 4 previous errors 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 c8582f8bfe7f0..dc905d076bb7d 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 @@ -7,6 +7,8 @@ LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b m | lifetime `'a` defined here LL | &mut ***p | ^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` 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 5946e7bf84950..c98ec477417bd 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 @@ -7,6 +7,8 @@ LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { | lifetime `'a` defined here LL | &mut **p | ^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-static-bound.migrate.nll.stderr b/src/test/ui/regions/regions-static-bound.migrate.nll.stderr index b5f3e6cfaba09..6f2c75d2ebad8 100644 --- a/src/test/ui/regions/regions-static-bound.migrate.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.migrate.nll.stderr @@ -5,6 +5,8 @@ LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here LL | t | ^ returning this value requires that `'a` must outlive `'static` + | + = help: consider replacing `'a` with `'static` error[E0621]: explicit lifetime required in the type of `u` --> $DIR/regions-static-bound.rs:14:5 diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.nll.stderr index 281683ac1da2b..6f2c75d2ebad8 100644 --- a/src/test/ui/regions/regions-static-bound.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.nll.stderr @@ -5,10 +5,8 @@ LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here LL | t | ^ returning this value requires that `'a` must outlive `'static` - -help: the following changes may resolve your lifetime errors | - = help: replace `'a` with `'static` + = help: consider replacing `'a` with `'static` error[E0621]: explicit lifetime required in the type of `u` --> $DIR/regions-static-bound.rs:14: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 f4b1a89db9a73..f92923a112584 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr @@ -8,6 +8,8 @@ LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { LL | // Without knowing 'a:'b, we can't coerce LL | x | ^ returning this value requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough --> $DIR/regions-trait-object-subtyping.rs:22:5 @@ -19,6 +21,8 @@ LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dum LL | // We can't coerce because it is packed in `Wrapper` LL | x | ^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr index f5b96f314c578..5352be430fbc5 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: S<'long, 'short>, ... LL | let _: S<'long, 'long> = c; | ^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr index 372510a2f7e28..22c9b915bb9ee 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Contravariant<'short>, ... LL | let _: Contravariant<'long> = c; | ^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr index e87e914727c5f..a07181ad553e6 100644 --- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Covariant<'long>, ... LL | let _: Covariant<'short> = c; | ^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr index adee33bfc7e83..d51db99f81f7b 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Invariant<'long>, ... LL | let _: Invariant<'short> = c; | ^^^^^^^^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr index 15853e6ca5d69..90388a1c51b1f 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr @@ -6,6 +6,8 @@ LL | fn use_<'b>(c: Invariant<'b>) { ... LL | let _: Invariant<'static> = c; | ^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'static` + | + = help: consider replacing `'b` with `'static` error: aborting due to previous error 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 344437f74e495..be18737b5f131 100644 --- a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr +++ b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr @@ -5,6 +5,8 @@ LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, & | ---- lifetime `'new` defined here LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:7:5 @@ -13,6 +15,8 @@ LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, ( | ---- lifetime `'new` defined here LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:10:5 @@ -21,6 +25,8 @@ LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, & | ---- lifetime `'new` defined here LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:13:5 @@ -29,6 +35,8 @@ LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, ( | ---- lifetime `'new` defined here LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:18:5 @@ -38,6 +46,8 @@ LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) LL | -> OccupiedEntry<'a, &'new (), ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:22:5 @@ -47,6 +57,8 @@ LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) LL | -> OccupiedEntry<'a, (), &'new ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:26:5 @@ -56,6 +68,8 @@ LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) LL | -> OccupiedEntry<'a, &'static (), ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:30:5 @@ -65,6 +79,8 @@ LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) LL | -> OccupiedEntry<'a, (), &'static ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:35:5 @@ -74,6 +90,8 @@ LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) LL | -> VacantEntry<'a, &'new (), ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:39:5 @@ -83,6 +101,8 @@ LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) LL | -> VacantEntry<'a, (), &'new ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:43:5 @@ -92,6 +112,8 @@ LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) LL | -> VacantEntry<'a, &'static (), ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: lifetime may not live long enough --> $DIR/variance-btree-invariant-types.rs:47:5 @@ -101,6 +123,8 @@ LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) LL | -> VacantEntry<'a, (), &'static ()> { LL | v | ^ returning this value requires that `'new` must outlive `'static` + | + = help: consider replacing `'new` with `'static` error: aborting due to 12 previous errors diff --git a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr b/src/test/ui/variance/variance-cell-is-invariant.nll.stderr index a3ae5320c90d4..1fcdfc4b5bbb2 100644 --- a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr +++ b/src/test/ui/variance/variance-cell-is-invariant.nll.stderr @@ -8,6 +8,8 @@ LL | fn use_<'short,'long>(c: Foo<'short>, ... LL | let _: Foo<'long> = c; | ^^^^^^^^^^ type annotation requires that `'short` must outlive `'long` + | + = help: consider adding the following bound: `'short: 'long` error: aborting due to previous error diff --git a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr index 69818aedd154c..91d4fd2e971fa 100644 --- a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-contravariant-arg-object.rs:22:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr index dbd75cb52fa83..6f136750ee13d 100644 --- a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-contravariant-arg-trait-match.rs:21:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr index 9212cf24be3bf..fe08ce0b84d21 100644 --- a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::<&'min G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-contravariant-self-trait-match.rs:22:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::<&'max G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr b/src/test/ui/variance/variance-covariant-arg-object.nll.stderr index 63ab7fe96512d..37fdea960be7c 100644 --- a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-covariant-arg-object.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-covariant-arg-object.rs:22:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr index 33589121c4b83..a982a29d499c4 100644 --- a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-covariant-arg-trait-match.rs:20:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr index 6b2413d68be29..81b25e38ec6d8 100644 --- a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::<&'min G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-covariant-self-trait-match.rs:20:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::<&'max G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr b/src/test/ui/variance/variance-invariant-arg-object.nll.stderr index fe2f35b63b57d..f6265980af7da 100644 --- a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-invariant-arg-object.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-invariant-arg-object.rs:18:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr index 2ab44c54c7216..2909e81fcbf76 100644 --- a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-invariant-arg-trait-match.rs:16:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::() | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr index 7b7c42fea8da8..01b2c8803ae72 100644 --- a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr @@ -8,6 +8,8 @@ LL | fn get_min_from_max<'min, 'max, G>() ... LL | impls_get::<&'min G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-invariant-self-trait-match.rs:16:5 @@ -19,6 +21,8 @@ LL | fn get_max_from_min<'min, 'max, G>() ... LL | impls_get::<&'max G>(); | ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: aborting due to 2 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 8468448b27bd2..eddd4b217c088 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 @@ -8,6 +8,8 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: '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 19a22f064beb0..a86c1b93a73b8 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 @@ -8,6 +8,8 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: '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 61f80fe77e63d..385d83adaf830 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 @@ -8,6 +8,8 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough --> $DIR/variance-use-invariant-struct-1.rs:19:5 @@ -19,6 +21,8 @@ LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) ... LL | v | ^ returning this value requires that `'min` must outlive `'max` + | + = help: consider adding the following bound: `'min: '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 338de6db18006..d031a68a51d9c 100644 --- a/src/test/ui/wf/wf-static-method.nll.stderr +++ b/src/test/ui/wf/wf-static-method.nll.stderr @@ -8,6 +8,8 @@ LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { ... LL | u | ^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/wf-static-method.rs:26:18 @@ -19,6 +21,8 @@ LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { ... LL | let me = Self::make_me(); | ^^^^^^^^^^^^^ requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/wf-static-method.rs:33:9 @@ -30,6 +34,8 @@ LL | impl<'a, 'b> Evil<'a, 'b> { LL | fn inherent_evil(u: &'b u32) -> &'a u32 { LL | u | ^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/wf-static-method.rs:41:5 @@ -40,6 +46,8 @@ LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { | lifetime `'a` defined here LL | <()>::static_evil(b) | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/wf-static-method.rs:45:5 @@ -50,6 +58,8 @@ LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { | lifetime `'a` defined here LL | ::static_evil(b) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough --> $DIR/wf-static-method.rs:50:5 @@ -60,6 +70,8 @@ LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { | lifetime `'a` defined here LL | ::inherent_evil(b) // bug? shouldn't this be an error | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` error: aborting due to 6 previous errors