Skip to content

Commit bfdefdb

Browse files
committed
Update tests based on feedback
- Add comment to some tests that will break when rust-lang#102745 is implemented - Mark a test with known-bug - Delete duplicate test
1 parent 0b3b046 commit bfdefdb

6 files changed

+7
-26
lines changed

src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ trait MyTrait {
1313
}
1414

1515
impl MyTrait for i32 {
16+
// This will break once a PR that implements #102745 is merged
1617
fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> {
1718
Box::pin(async {
1819
*self

src/test/ui/async-await/in-trait/async-example-desugared-in-trait.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ trait MyTrait {
1212
}
1313

1414
impl MyTrait for i32 {
15+
// This will break once a PR that implements #102745 is merged
1516
async fn foo(&self) -> i32 {
1617
*self
1718
}

src/test/ui/async-await/in-trait/async-example-desugared.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ trait MyTrait {
1212
}
1313

1414
impl MyTrait for i32 {
15+
// This will break once a PR that implements #102745 is merged
1516
fn foo(&self) -> impl Future<Output = i32> + '_ {
1617
async {
1718
*self

src/test/ui/async-await/in-trait/async-lifetimes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
// check-fail
2+
// known-bug: #102682
13
// edition: 2021
24

35
#![feature(async_fn_in_trait)]
46
#![allow(incomplete_features)]
57

68
trait MyTrait<'a, 'b, T> {
79
async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
8-
//~^ ERROR the parameter type `Self` may not live long enough
9-
//~| ERROR the parameter type `T` may not live long enough
1010
}
1111

1212
impl<'a, 'b, T, U> MyTrait<'a, 'b, T> for U {

src/test/ui/async-await/in-trait/async-lifetimes.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0309]: the parameter type `Self` may not live long enough
2-
--> $DIR/async-lifetimes.rs:7:43
2+
--> $DIR/async-lifetimes.rs:9:43
33
|
44
LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
55
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
88
= note: ...so that the reference type `&'a Self` does not outlive the data it points at
99

1010
error[E0309]: the parameter type `T` may not live long enough
11-
--> $DIR/async-lifetimes.rs:7:43
11+
--> $DIR/async-lifetimes.rs:9:43
1212
|
1313
LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
1414
| ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'b T` does not outlive the data it points at

src/test/ui/async-await/in-trait/fn-not-async-err2-rpitit.rs

-22
This file was deleted.

0 commit comments

Comments
 (0)