Skip to content

Commit 07e018d

Browse files
committed
Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty
1 parent 8a5574b commit 07e018d

31 files changed

+145
-10
lines changed

tests/ui/async-await/in-trait/async-associated-types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22
// edition: 2021
3+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4+
// revisions: current next
35

46
#![feature(async_fn_in_trait)]
57
#![feature(impl_trait_projections)]

tests/ui/async-await/in-trait/async-associated-types2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22
// edition: 2021
3+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4+
// revisions: current next
35

46
#![feature(async_fn_in_trait)]
57
#![feature(type_alias_impl_trait)]

tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr renamed to tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0053]: method `foo` has an incompatible type for trait
2-
--> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
2+
--> $DIR/async-example-desugared-boxed-in-trait.rs:17:28
33
|
44
LL | async fn foo(&self) -> i32 {
55
| ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
66
|
77
note: type in trait
8-
--> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
8+
--> $DIR/async-example-desugared-boxed-in-trait.rs:13:22
99
|
1010
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0053]: method `foo` has an incompatible type for trait
2+
--> $DIR/async-example-desugared-boxed-in-trait.rs:17:28
3+
|
4+
LL | async fn foo(&self) -> i32 {
5+
| ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
6+
|
7+
note: type in trait
8+
--> $DIR/async-example-desugared-boxed-in-trait.rs:13:22
9+
|
10+
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= note: expected signature `fn(&i32) -> Pin<Box<dyn Future<Output = i32>>>`
13+
found signature `fn(&i32) -> impl Future<Output = i32>`
14+
15+
error: aborting due to previous error
16+
17+
For more information about this error, try `rustc --explain E0053`.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// edition: 2021
2+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3+
// revisions: current next
24

35
#![feature(async_fn_in_trait)]
46
#![feature(return_position_impl_trait_in_trait)]

tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr renamed to tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: method `foo` should be async because the method from the trait is async
2-
--> $DIR/async-example-desugared-boxed.rs:15:5
2+
--> $DIR/async-example-desugared-boxed.rs:17:5
33
|
44
LL | async fn foo(&self) -> i32;
55
| --------------------------- required because the trait method is async
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: method `foo` should be async because the method from the trait is async
2+
--> $DIR/async-example-desugared-boxed.rs:17:5
3+
|
4+
LL | async fn foo(&self) -> i32;
5+
| --------------------------- required because the trait method is async
6+
...
7+
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> {
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
error: aborting due to previous error
11+

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// edition: 2021
2+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3+
// revisions: current next
24

35
#![feature(async_fn_in_trait)]
46
#![feature(return_position_impl_trait_in_trait)]

tests/ui/async-await/in-trait/async-example-desugared-extra.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22
// edition: 2021
3+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4+
// revisions: current next
35

46
#![feature(async_fn_in_trait)]
57
#![feature(return_position_impl_trait_in_trait)]

tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22
// edition: 2021
3+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4+
// revisions: current next
35

46
#![feature(async_fn_in_trait)]
57
#![feature(return_position_impl_trait_in_trait)]

0 commit comments

Comments
 (0)