diff options
Diffstat (limited to 'src/test')
11 files changed, 43 insertions, 32 deletions
diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr index 4b860a55057..5a382ded70b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -36,6 +36,9 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/propagate-from-trait-match.rs:32:36 | +LL | fn supply<'a, T>(value: T) + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | establish_relationships(value, |value| { | ____________________________________^ LL | | @@ -45,8 +48,6 @@ LL | | // This function call requires that LL | | require(value); LL | | }); | |_____^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr b/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr index 31ee540cce9..d303b8c84c1 100644 --- a/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr +++ b/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr @@ -1,18 +1,20 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/impl-trait-outlives.rs:11:5 | +LL | fn no_region<'a, T>(x: Box<T>) -> impl Debug + 'a + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | x | ^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error[E0309]: the parameter type `T` may not live long enough --> $DIR/impl-trait-outlives.rs:26:5 | +LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> impl Debug + 'a + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | x | ^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr b/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr index 9f0c60c1e17..faa90e3e564 100644 --- a/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr +++ b/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr @@ -1,10 +1,10 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/projection-implied-bounds.rs:30:18 | +LL | fn generic2<T: Iterator>(value: T) { + | -- help: consider adding an explicit lifetime bound...: `T: 'static +` LL | twice(value, |value_ref, item| invoke2(value_ref, item)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'static`... error: aborting due to previous error 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 2513b0bfccb..cec1c277e7f 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 @@ -31,10 +31,11 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-one-region-closure.rs:45:29 | +LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: lifetime may not live long enough --> $DIR/projection-one-region-closure.rs:45:39 @@ -81,10 +82,11 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-one-region-closure.rs:56:29 | +LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: lifetime may not live long enough --> $DIR/projection-one-region-closure.rs:56:39 diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr index 8175c302155..ad2571e44f5 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr @@ -1,10 +1,11 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-where-clause-none.rs:16:5 | +LL | fn foo<'a, T>() -> &'a () + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | bar::<T::Output>() | ^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index baf223b786b..1f232f35043 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -52,10 +52,10 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24 | +LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) { + | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 88d73e7a729..7b1f8192cb6 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -29,18 +29,20 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23 | +LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a> + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | with_signature(x, |y| y) | ^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5 | +LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a> + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | x | ^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index 5b175aac1e1..eaa536ec3a4 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -37,6 +37,8 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 | +LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { + | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | with_signature(a, b, |x, y| { | __________________________^ LL | | @@ -46,8 +48,6 @@ LL | | // See `correct_region`, which explains the point of this LL | | require(&x, &y) LL | | }) | |_____^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 @@ -121,6 +121,9 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 | +LL | fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | with_signature(a, b, |x, y| { | __________________________^ LL | | @@ -128,8 +131,6 @@ LL | | // See `correct_region` LL | | require(&x, &y) LL | | }) | |_____^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr index 9a023a0e58e..3cfc23ffcfd 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr @@ -1,10 +1,10 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn-body.rs:19:5 | +LL | fn region_static<'a, T>(cell: Cell<&'a usize>, t: T) { + | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | outlives(cell, t) | ^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr index 8c8529620d5..981d3d03b82 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr @@ -1,18 +1,20 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn.rs:11:5 | +LL | fn no_region<'a, T>(x: Box<T>) -> Box<Debug + 'a> + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | x | ^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn.rs:26:5 | +LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a> + | - help: consider adding an explicit lifetime bound...: `T: 'a` +... LL | x | ^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr index db771d21132..a0b955112d2 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr @@ -19,10 +19,10 @@ LL | type WrongGeneric<T> = impl 'static; error[E0310]: the parameter type `T` may not live long enough --> $DIR/generic_type_does_not_live_long_enough.rs:18:5 | +LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> { + | - help: consider adding an explicit lifetime bound...: `T: 'static` LL | t | ^ - | - = help: consider adding an explicit lifetime bound `T: 'static`... error: aborting due to 3 previous errors |
