summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr')
-rw-r--r--tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr b/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
new file mode 100644
index 000000000..ae4d0d585
--- /dev/null
+++ b/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
@@ -0,0 +1,35 @@
+error: lifetime may not live long enough
+ --> $DIR/ret-impl-trait-one.rs:10:85
+ |
+LL | async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
+ | ________________________________--__--_______________________________________________^
+ | | | |
+ | | | lifetime `'b` defined here
+ | | lifetime `'a` defined here
+LL | |
+LL | | (a, b)
+LL | | }
+ | |_^ 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[E0700]: hidden type for `impl Trait<'a>` captures lifetime that does not appear in bounds
+ --> $DIR/ret-impl-trait-one.rs:16:80
+ |
+LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> {
+ | ____________________________________--__________________________________________^
+ | | |
+ | | hidden type `(&'a u8, &'b u8)` captures the lifetime `'b` as defined here
+LL | |
+LL | | (a, b)
+LL | | }
+ | |_^
+ |
+help: to declare that `impl Trait<'a>` captures `'b`, you can add an explicit `'b` lifetime bound
+ |
+LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
+ | ++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0700`.