summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/multiple-lifetimes
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/multiple-lifetimes')
-rw-r--r--tests/ui/async-await/multiple-lifetimes/member-constraints-min-choice-issue-63033.rs10
-rw-r--r--tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr5
-rw-r--r--tests/ui/async-await/multiple-lifetimes/ret-ref.stderr12
3 files changed, 19 insertions, 8 deletions
diff --git a/tests/ui/async-await/multiple-lifetimes/member-constraints-min-choice-issue-63033.rs b/tests/ui/async-await/multiple-lifetimes/member-constraints-min-choice-issue-63033.rs
new file mode 100644
index 000000000..614f18972
--- /dev/null
+++ b/tests/ui/async-await/multiple-lifetimes/member-constraints-min-choice-issue-63033.rs
@@ -0,0 +1,10 @@
+// Regression test for #63033.
+
+// check-pass
+// edition: 2018
+
+async fn test1(_: &'static u8, _: &'_ u8, _: &'_ u8) {}
+
+async fn test2<'s>(_: &'s u8, _: &'_ &'s u8, _: &'_ &'s u8) {}
+
+fn main() {}
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
index ae4d0d585..5ae1d78a9 100644
--- a/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
+++ b/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
@@ -17,8 +17,9 @@ error[E0700]: hidden type for `impl Trait<'a>` captures lifetime that does not a
--> $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> {
- | ____________________________________--__________________________________________^
- | | |
+ | ____________________________________--___________________________--------------_^
+ | | | |
+ | | | opaque type defined here
| | hidden type `(&'a u8, &'b u8)` captures the lifetime `'b` as defined here
LL | |
LL | | (a, b)
diff --git a/tests/ui/async-await/multiple-lifetimes/ret-ref.stderr b/tests/ui/async-await/multiple-lifetimes/ret-ref.stderr
index d86e84033..a599ac1d9 100644
--- a/tests/ui/async-await/multiple-lifetimes/ret-ref.stderr
+++ b/tests/ui/async-await/multiple-lifetimes/ret-ref.stderr
@@ -2,9 +2,9 @@ error[E0506]: cannot assign to `a` because it is borrowed
--> $DIR/ret-ref.rs:16:5
|
LL | let future = multiple_named_lifetimes(&a, &b);
- | -- borrow of `a` occurs here
+ | -- `a` is borrowed here
LL | a += 1;
- | ^^^^^^ assignment to borrowed `a` occurs here
+ | ^^^^^^ `a` is assigned to here but it was already borrowed
LL | b += 1;
LL | let p = future.await;
| ------ borrow later used here
@@ -13,10 +13,10 @@ error[E0506]: cannot assign to `b` because it is borrowed
--> $DIR/ret-ref.rs:17:5
|
LL | let future = multiple_named_lifetimes(&a, &b);
- | -- borrow of `b` occurs here
+ | -- `b` is borrowed here
LL | a += 1;
LL | b += 1;
- | ^^^^^^ assignment to borrowed `b` occurs here
+ | ^^^^^^ `b` is assigned to here but it was already borrowed
LL | let p = future.await;
| ------ borrow later used here
@@ -24,10 +24,10 @@ error[E0506]: cannot assign to `a` because it is borrowed
--> $DIR/ret-ref.rs:28:5
|
LL | let future = multiple_named_lifetimes(&a, &b);
- | -- borrow of `a` occurs here
+ | -- `a` is borrowed here
LL | let p = future.await;
LL | a += 1;
- | ^^^^^^ assignment to borrowed `a` occurs here
+ | ^^^^^^ `a` is assigned to here but it was already borrowed
LL | b += 1;
LL | drop(p);
| - borrow later used here