summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr')
-rw-r--r--tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr22
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