diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 433024c30..4f93fb4ea 100644 --- a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -25,11 +25,16 @@ LL | | T: Iterator, error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough --> $DIR/projection-no-regions-closure.rs:25:31 | +LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a> + | -- the associated type `<T as Iterator>::Item` must be valid for the lifetime `'a` as defined here... +... LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds | - = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`... - = note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds +help: consider adding an explicit lifetime bound + | +LL | T: Iterator, <T as Iterator>::Item: 'a + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: external requirements --> $DIR/projection-no-regions-closure.rs:34:23 @@ -82,11 +87,16 @@ LL | | T: 'b + Iterator, error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough --> $DIR/projection-no-regions-closure.rs:42:31 | +LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a> + | -- the associated type `<T as Iterator>::Item` must be valid for the lifetime `'a` as defined here... +... LL | with_signature(x, |mut y| Box::new(y.next())) - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound | - = help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`... - = note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds +LL | T: 'b + Iterator, <T as Iterator>::Item: 'a + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: external requirements --> $DIR/projection-no-regions-closure.rs:52:23 |