From 023939b627b7dc93b01471f7d41fb8553ddb4ffa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:24 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- .../async-await/in-trait/async-associated-types.rs | 2 -- .../in-trait/async-default-fn-overridden.rs | 2 -- ...example-desugared-boxed-in-trait.current.stderr | 17 ---------- ...nc-example-desugared-boxed-in-trait.next.stderr | 17 ---------- .../async-example-desugared-boxed-in-trait.rs | 2 -- .../async-example-desugared-boxed-in-trait.stderr | 17 ++++++++++ .../async-example-desugared-boxed.current.stderr | 11 ------ .../async-example-desugared-boxed.next.stderr | 11 ------ .../in-trait/async-example-desugared-boxed.rs | 2 -- .../in-trait/async-example-desugared-boxed.stderr | 11 ++++++ .../in-trait/async-example-desugared-extra.rs | 2 -- .../in-trait/async-example-desugared-in-trait.rs | 2 -- .../async-example-desugared-manual.current.stderr | 11 ------ .../async-example-desugared-manual.next.stderr | 11 ------ .../in-trait/async-example-desugared-manual.rs | 2 -- .../in-trait/async-example-desugared-manual.stderr | 11 ++++++ .../in-trait/async-example-desugared.rs | 2 -- .../async-generics-and-bounds.current.stderr | 37 -------------------- .../in-trait/async-generics-and-bounds.next.stderr | 37 -------------------- .../in-trait/async-generics-and-bounds.rs | 2 -- .../in-trait/async-generics-and-bounds.stderr | 37 ++++++++++++++++++++ .../in-trait/async-generics.current.stderr | 37 -------------------- .../in-trait/async-generics.next.stderr | 37 -------------------- tests/ui/async-await/in-trait/async-generics.rs | 2 -- .../ui/async-await/in-trait/async-generics.stderr | 37 ++++++++++++++++++++ .../in-trait/async-lifetimes-and-bounds.rs | 2 -- tests/ui/async-await/in-trait/async-lifetimes.rs | 2 -- .../async-recursive-generic.current.stderr | 12 ------- .../in-trait/async-recursive-generic.next.stderr | 12 ------- .../in-trait/async-recursive-generic.rs | 2 -- .../in-trait/async-recursive-generic.stderr | 12 +++++++ .../in-trait/async-recursive.current.stderr | 12 ------- .../in-trait/async-recursive.next.stderr | 12 ------- tests/ui/async-await/in-trait/async-recursive.rs | 2 -- .../ui/async-await/in-trait/async-recursive.stderr | 12 +++++++ .../in-trait/bad-signatures.current.stderr | 17 ---------- .../in-trait/bad-signatures.next.stderr | 17 ---------- tests/ui/async-await/in-trait/bad-signatures.rs | 2 -- .../ui/async-await/in-trait/bad-signatures.stderr | 17 ++++++++++ ...ject-to-specializable-projection.current.stderr | 10 ------ ...project-to-specializable-projection.next.stderr | 25 -------------- .../dont-project-to-specializable-projection.rs | 2 -- ...dont-project-to-specializable-projection.stderr | 25 ++++++++++++++ tests/ui/async-await/in-trait/early-bound-1.rs | 2 -- tests/ui/async-await/in-trait/early-bound-2.rs | 2 -- .../in-trait/fn-not-async-err2.current.stderr | 12 ------- .../in-trait/fn-not-async-err2.next.stderr | 12 ------- tests/ui/async-await/in-trait/fn-not-async-err2.rs | 2 -- .../async-await/in-trait/fn-not-async-err2.stderr | 12 +++++++ .../in-trait/generics-mismatch.current.stderr | 16 --------- .../in-trait/generics-mismatch.next.stderr | 16 --------- tests/ui/async-await/in-trait/implied-bounds.rs | 2 -- tests/ui/async-await/in-trait/issue-102138.rs | 2 -- tests/ui/async-await/in-trait/issue-102219.rs | 2 -- tests/ui/async-await/in-trait/issue-102310.rs | 2 -- tests/ui/async-await/in-trait/issue-104678.rs | 2 -- .../in-trait/lifetime-mismatch.current.stderr | 12 ------- .../in-trait/lifetime-mismatch.next.stderr | 12 ------- tests/ui/async-await/in-trait/lifetime-mismatch.rs | 2 -- .../async-await/in-trait/lifetime-mismatch.stderr | 12 +++++++ .../in-trait/missing-feature-flag.current.stderr | 30 ----------------- .../in-trait/missing-feature-flag.next.stderr | 30 ----------------- .../async-await/in-trait/missing-feature-flag.rs | 2 -- .../in-trait/missing-feature-flag.stderr | 30 +++++++++++++++++ .../in-trait/missing-send-bound.current.stderr | 20 ----------- .../in-trait/missing-send-bound.next.stderr | 20 ----------- .../ui/async-await/in-trait/missing-send-bound.rs | 2 -- .../async-await/in-trait/missing-send-bound.stderr | 20 +++++++++++ .../in-trait/object-safety.current.stderr | 18 ---------- .../async-await/in-trait/object-safety.next.stderr | 18 ---------- tests/ui/async-await/in-trait/object-safety.rs | 2 -- tests/ui/async-await/in-trait/object-safety.stderr | 18 ++++++++++ .../return-not-existing-pair.current.stderr | 39 ---------------------- .../in-trait/return-not-existing-pair.next.stderr | 39 ---------------------- .../in-trait/return-not-existing-pair.rs | 2 -- .../in-trait/return-not-existing-pair.stderr | 39 ++++++++++++++++++++++ ...ot-existing-type-wrapping-rpitit.current.stderr | 9 ----- ...n-not-existing-type-wrapping-rpitit.next.stderr | 9 ----- .../return-not-existing-type-wrapping-rpitit.rs | 2 -- ...return-not-existing-type-wrapping-rpitit.stderr | 9 +++++ .../in-trait/return-type-suggestion.current.stderr | 14 -------- .../in-trait/return-type-suggestion.next.stderr | 14 -------- .../async-await/in-trait/return-type-suggestion.rs | 3 -- .../in-trait/return-type-suggestion.stderr | 12 +++++++ 84 files changed, 331 insertions(+), 746 deletions(-) delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-example-desugared-manual.stderr delete mode 100644 tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-generics-and-bounds.stderr delete mode 100644 tests/ui/async-await/in-trait/async-generics.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-generics.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-generics.stderr delete mode 100644 tests/ui/async-await/in-trait/async-recursive-generic.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-recursive-generic.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-recursive-generic.stderr delete mode 100644 tests/ui/async-await/in-trait/async-recursive.current.stderr delete mode 100644 tests/ui/async-await/in-trait/async-recursive.next.stderr create mode 100644 tests/ui/async-await/in-trait/async-recursive.stderr delete mode 100644 tests/ui/async-await/in-trait/bad-signatures.current.stderr delete mode 100644 tests/ui/async-await/in-trait/bad-signatures.next.stderr create mode 100644 tests/ui/async-await/in-trait/bad-signatures.stderr delete mode 100644 tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr delete mode 100644 tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr create mode 100644 tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr delete mode 100644 tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr delete mode 100644 tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr create mode 100644 tests/ui/async-await/in-trait/fn-not-async-err2.stderr delete mode 100644 tests/ui/async-await/in-trait/generics-mismatch.current.stderr delete mode 100644 tests/ui/async-await/in-trait/generics-mismatch.next.stderr delete mode 100644 tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr delete mode 100644 tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr create mode 100644 tests/ui/async-await/in-trait/lifetime-mismatch.stderr delete mode 100644 tests/ui/async-await/in-trait/missing-feature-flag.current.stderr delete mode 100644 tests/ui/async-await/in-trait/missing-feature-flag.next.stderr create mode 100644 tests/ui/async-await/in-trait/missing-feature-flag.stderr delete mode 100644 tests/ui/async-await/in-trait/missing-send-bound.current.stderr delete mode 100644 tests/ui/async-await/in-trait/missing-send-bound.next.stderr create mode 100644 tests/ui/async-await/in-trait/missing-send-bound.stderr delete mode 100644 tests/ui/async-await/in-trait/object-safety.current.stderr delete mode 100644 tests/ui/async-await/in-trait/object-safety.next.stderr create mode 100644 tests/ui/async-await/in-trait/object-safety.stderr delete mode 100644 tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr delete mode 100644 tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr create mode 100644 tests/ui/async-await/in-trait/return-not-existing-pair.stderr delete mode 100644 tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr delete mode 100644 tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr create mode 100644 tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.stderr delete mode 100644 tests/ui/async-await/in-trait/return-type-suggestion.current.stderr delete mode 100644 tests/ui/async-await/in-trait/return-type-suggestion.next.stderr create mode 100644 tests/ui/async-await/in-trait/return-type-suggestion.stderr (limited to 'tests/ui/async-await/in-trait') diff --git a/tests/ui/async-await/in-trait/async-associated-types.rs b/tests/ui/async-await/in-trait/async-associated-types.rs index 89ca4039b..974f5aaff 100644 --- a/tests/ui/async-await/in-trait/async-associated-types.rs +++ b/tests/ui/async-await/in-trait/async-associated-types.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(impl_trait_projections)] diff --git a/tests/ui/async-await/in-trait/async-default-fn-overridden.rs b/tests/ui/async-await/in-trait/async-default-fn-overridden.rs index 99c3ba6a3..06413fe6f 100644 --- a/tests/ui/async-await/in-trait/async-default-fn-overridden.rs +++ b/tests/ui/async-await/in-trait/async-default-fn-overridden.rs @@ -1,7 +1,5 @@ // run-pass // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr deleted file mode 100644 index b5ace9ada..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0053]: method `foo` has an incompatible type for trait - --> $DIR/async-example-desugared-boxed-in-trait.rs:17:28 - | -LL | async fn foo(&self) -> i32 { - | ^^^ expected `Pin>>`, found future - | -note: type in trait - --> $DIR/async-example-desugared-boxed-in-trait.rs:13:22 - | -LL | fn foo(&self) -> Pin + '_>>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected signature `fn(&i32) -> Pin>>` - found signature `fn(&i32) -> impl Future` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr deleted file mode 100644 index b5ace9ada..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0053]: method `foo` has an incompatible type for trait - --> $DIR/async-example-desugared-boxed-in-trait.rs:17:28 - | -LL | async fn foo(&self) -> i32 { - | ^^^ expected `Pin>>`, found future - | -note: type in trait - --> $DIR/async-example-desugared-boxed-in-trait.rs:13:22 - | -LL | fn foo(&self) -> Pin + '_>>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected signature `fn(&i32) -> Pin>>` - found signature `fn(&i32) -> impl Future` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs index 7b53379b2..38ba29718 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr new file mode 100644 index 000000000..168ef8e9e --- /dev/null +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr @@ -0,0 +1,17 @@ +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28 + | +LL | async fn foo(&self) -> i32 { + | ^^^ expected `Pin>>`, found future + | +note: type in trait + --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22 + | +LL | fn foo(&self) -> Pin + '_>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected signature `fn(&i32) -> Pin>>` + found signature `fn(&i32) -> impl Future` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr deleted file mode 100644 index 6c0b58591..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: method `foo` should be async because the method from the trait is async - --> $DIR/async-example-desugared-boxed.rs:17:5 - | -LL | async fn foo(&self) -> i32; - | --------------------------- required because the trait method is async -... -LL | fn foo(&self) -> Pin + '_>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr deleted file mode 100644 index 6c0b58591..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: method `foo` should be async because the method from the trait is async - --> $DIR/async-example-desugared-boxed.rs:17:5 - | -LL | async fn foo(&self) -> i32; - | --------------------------- required because the trait method is async -... -LL | fn foo(&self) -> Pin + '_>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs b/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs index 916488ffa..1b1b3cffd 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr new file mode 100644 index 000000000..60fa534a6 --- /dev/null +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr @@ -0,0 +1,11 @@ +error: method `foo` should be async because the method from the trait is async + --> $DIR/async-example-desugared-boxed.rs:15:5 + | +LL | async fn foo(&self) -> i32; + | --------------------------- required because the trait method is async +... +LL | fn foo(&self) -> Pin + '_>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/tests/ui/async-await/in-trait/async-example-desugared-extra.rs b/tests/ui/async-await/in-trait/async-example-desugared-extra.rs index edac0b374..81e1e59a3 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-extra.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared-extra.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs b/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs index 934f7643d..feeda719e 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr deleted file mode 100644 index 0d2551ab8..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: method `foo` should be async because the method from the trait is async - --> $DIR/async-example-desugared-manual.rs:25:5 - | -LL | async fn foo(&self) -> i32; - | --------------------------- required because the trait method is async -... -LL | fn foo(&self) -> MyFuture { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr deleted file mode 100644 index 0d2551ab8..000000000 --- a/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: method `foo` should be async because the method from the trait is async - --> $DIR/async-example-desugared-manual.rs:25:5 - | -LL | async fn foo(&self) -> i32; - | --------------------------- required because the trait method is async -... -LL | fn foo(&self) -> MyFuture { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.rs b/tests/ui/async-await/in-trait/async-example-desugared-manual.rs index 4883828d3..71473e745 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-manual.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr new file mode 100644 index 000000000..567a36a86 --- /dev/null +++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr @@ -0,0 +1,11 @@ +error: method `foo` should be async because the method from the trait is async + --> $DIR/async-example-desugared-manual.rs:23:5 + | +LL | async fn foo(&self) -> i32; + | --------------------------- required because the trait method is async +... +LL | fn foo(&self) -> MyFuture { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/tests/ui/async-await/in-trait/async-example-desugared.rs b/tests/ui/async-await/in-trait/async-example-desugared.rs index 214171b2e..fb92ec786 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared.rs +++ b/tests/ui/async-await/in-trait/async-example-desugared.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr deleted file mode 100644 index 780da0689..000000000 --- a/tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0311]: the parameter type `U` may not live long enough - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - | -note: the parameter type `U` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics-and-bounds.rs:14:18 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - | -note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics-and-bounds.rs:14:18 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr deleted file mode 100644 index 780da0689..000000000 --- a/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0311]: the parameter type `U` may not live long enough - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - | -note: the parameter type `U` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics-and-bounds.rs:14:18 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - | -note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics-and-bounds.rs:14:18 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics-and-bounds.rs:14:28 - | -LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.rs b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs index 146e74ec2..a73d55adf 100644 --- a/tests/ui/async-await/in-trait/async-generics-and-bounds.rs +++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs @@ -1,8 +1,6 @@ // check-fail // known-bug: #102682 // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr new file mode 100644 index 000000000..5c8d64fc6 --- /dev/null +++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr @@ -0,0 +1,37 @@ +error[E0311]: the parameter type `U` may not live long enough + --> $DIR/async-generics-and-bounds.rs:12:28 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^^^^^^^ + | +note: the parameter type `U` must be valid for the anonymous lifetime as defined here... + --> $DIR/async-generics-and-bounds.rs:12:18 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^ +note: ...so that the reference type `&(T, U)` does not outlive the data it points at + --> $DIR/async-generics-and-bounds.rs:12:28 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^^^^^^^ + +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/async-generics-and-bounds.rs:12:28 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^^^^^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime as defined here... + --> $DIR/async-generics-and-bounds.rs:12:18 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^ +note: ...so that the reference type `&(T, U)` does not outlive the data it points at + --> $DIR/async-generics-and-bounds.rs:12:28 + | +LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-generics.current.stderr b/tests/ui/async-await/in-trait/async-generics.current.stderr deleted file mode 100644 index 04e1ab6d7..000000000 --- a/tests/ui/async-await/in-trait/async-generics.current.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0311]: the parameter type `U` may not live long enough - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - | -note: the parameter type `U` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics.rs:11:18 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - | -note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics.rs:11:18 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-generics.next.stderr b/tests/ui/async-await/in-trait/async-generics.next.stderr deleted file mode 100644 index 04e1ab6d7..000000000 --- a/tests/ui/async-await/in-trait/async-generics.next.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0311]: the parameter type `U` may not live long enough - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - | -note: the parameter type `U` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics.rs:11:18 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - | -note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/async-generics.rs:11:18 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^ -note: ...so that the reference type `&(T, U)` does not outlive the data it points at - --> $DIR/async-generics.rs:11:28 - | -LL | async fn foo(&self) -> &(T, U); - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-generics.rs b/tests/ui/async-await/in-trait/async-generics.rs index 507500abf..67000e577 100644 --- a/tests/ui/async-await/in-trait/async-generics.rs +++ b/tests/ui/async-await/in-trait/async-generics.rs @@ -1,8 +1,6 @@ // check-fail // known-bug: #102682 // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-generics.stderr b/tests/ui/async-await/in-trait/async-generics.stderr new file mode 100644 index 000000000..6ae73d9e3 --- /dev/null +++ b/tests/ui/async-await/in-trait/async-generics.stderr @@ -0,0 +1,37 @@ +error[E0311]: the parameter type `U` may not live long enough + --> $DIR/async-generics.rs:9:28 + | +LL | async fn foo(&self) -> &(T, U); + | ^^^^^^^ + | +note: the parameter type `U` must be valid for the anonymous lifetime as defined here... + --> $DIR/async-generics.rs:9:18 + | +LL | async fn foo(&self) -> &(T, U); + | ^ +note: ...so that the reference type `&(T, U)` does not outlive the data it points at + --> $DIR/async-generics.rs:9:28 + | +LL | async fn foo(&self) -> &(T, U); + | ^^^^^^^ + +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/async-generics.rs:9:28 + | +LL | async fn foo(&self) -> &(T, U); + | ^^^^^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime as defined here... + --> $DIR/async-generics.rs:9:18 + | +LL | async fn foo(&self) -> &(T, U); + | ^ +note: ...so that the reference type `&(T, U)` does not outlive the data it points at + --> $DIR/async-generics.rs:9:28 + | +LL | async fn foo(&self) -> &(T, U); + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0311`. diff --git a/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs b/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs index 9869a8d71..d5481d277 100644 --- a/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs +++ b/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-lifetimes.rs b/tests/ui/async-await/in-trait/async-lifetimes.rs index ecbd1910a..f298e45d2 100644 --- a/tests/ui/async-await/in-trait/async-lifetimes.rs +++ b/tests/ui/async-await/in-trait/async-lifetimes.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.current.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.current.stderr deleted file mode 100644 index 67b491f19..000000000 --- a/tests/ui/async-await/in-trait/async-recursive-generic.current.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/async-recursive-generic.rs:13:48 - | -LL | async fn foo_recursive(&self, n: usize) -> T { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr deleted file mode 100644 index 67b491f19..000000000 --- a/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/async-recursive-generic.rs:13:48 - | -LL | async fn foo_recursive(&self, n: usize) -> T { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.rs b/tests/ui/async-await/in-trait/async-recursive-generic.rs index 64c6ba15c..6839abd38 100644 --- a/tests/ui/async-await/in-trait/async-recursive-generic.rs +++ b/tests/ui/async-await/in-trait/async-recursive-generic.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.stderr new file mode 100644 index 000000000..cab173bdd --- /dev/null +++ b/tests/ui/async-await/in-trait/async-recursive-generic.stderr @@ -0,0 +1,12 @@ +error[E0733]: recursion in an `async fn` requires boxing + --> $DIR/async-recursive-generic.rs:11:48 + | +LL | async fn foo_recursive(&self, n: usize) -> T { + | ^ recursive `async fn` + | + = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` + = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/async-recursive.current.stderr b/tests/ui/async-await/in-trait/async-recursive.current.stderr deleted file mode 100644 index 85af27e37..000000000 --- a/tests/ui/async-await/in-trait/async-recursive.current.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/async-recursive.rs:13:48 - | -LL | async fn foo_recursive(&self, n: usize) -> i32 { - | ^^^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/async-recursive.next.stderr b/tests/ui/async-await/in-trait/async-recursive.next.stderr deleted file mode 100644 index 85af27e37..000000000 --- a/tests/ui/async-await/in-trait/async-recursive.next.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/async-recursive.rs:13:48 - | -LL | async fn foo_recursive(&self, n: usize) -> i32 { - | ^^^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/async-recursive.rs b/tests/ui/async-await/in-trait/async-recursive.rs index d928909e3..61119f809 100644 --- a/tests/ui/async-await/in-trait/async-recursive.rs +++ b/tests/ui/async-await/in-trait/async-recursive.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/async-recursive.stderr b/tests/ui/async-await/in-trait/async-recursive.stderr new file mode 100644 index 000000000..9feff37b3 --- /dev/null +++ b/tests/ui/async-await/in-trait/async-recursive.stderr @@ -0,0 +1,12 @@ +error[E0733]: recursion in an `async fn` requires boxing + --> $DIR/async-recursive.rs:11:48 + | +LL | async fn foo_recursive(&self, n: usize) -> i32 { + | ^^^ recursive `async fn` + | + = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` + = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/in-trait/bad-signatures.current.stderr b/tests/ui/async-await/in-trait/bad-signatures.current.stderr deleted file mode 100644 index ae590fb05..000000000 --- a/tests/ui/async-await/in-trait/bad-signatures.current.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: expected identifier, found keyword `self` - --> $DIR/bad-signatures.rs:8:23 - | -LL | async fn bar(&abc self); - | ^^^^ expected identifier, found keyword - -error: expected one of `:`, `@`, or `|`, found keyword `self` - --> $DIR/bad-signatures.rs:8:23 - | -LL | async fn bar(&abc self); - | -----^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/async-await/in-trait/bad-signatures.next.stderr b/tests/ui/async-await/in-trait/bad-signatures.next.stderr deleted file mode 100644 index ae590fb05..000000000 --- a/tests/ui/async-await/in-trait/bad-signatures.next.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: expected identifier, found keyword `self` - --> $DIR/bad-signatures.rs:8:23 - | -LL | async fn bar(&abc self); - | ^^^^ expected identifier, found keyword - -error: expected one of `:`, `@`, or `|`, found keyword `self` - --> $DIR/bad-signatures.rs:8:23 - | -LL | async fn bar(&abc self); - | -----^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/async-await/in-trait/bad-signatures.rs b/tests/ui/async-await/in-trait/bad-signatures.rs index 4baddd8cc..98dddc126 100644 --- a/tests/ui/async-await/in-trait/bad-signatures.rs +++ b/tests/ui/async-await/in-trait/bad-signatures.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/bad-signatures.stderr b/tests/ui/async-await/in-trait/bad-signatures.stderr new file mode 100644 index 000000000..7cbd96e24 --- /dev/null +++ b/tests/ui/async-await/in-trait/bad-signatures.stderr @@ -0,0 +1,17 @@ +error: expected identifier, found keyword `self` + --> $DIR/bad-signatures.rs:6:23 + | +LL | async fn bar(&abc self); + | ^^^^ expected identifier, found keyword + +error: expected one of `:`, `@`, or `|`, found keyword `self` + --> $DIR/bad-signatures.rs:6:23 + | +LL | async fn bar(&abc self); + | -----^^^^ + | | | + | | expected one of `:`, `@`, or `|` + | help: declare the type after the parameter binding: `: ` + +error: aborting due to 2 previous errors + diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr deleted file mode 100644 index eec5ab065..000000000 --- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: async associated function in trait cannot be specialized - --> $DIR/dont-project-to-specializable-projection.rs:16:5 - | -LL | default async fn foo(_: T) -> &'static str { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr deleted file mode 100644 index 25a7f3bb5..000000000 --- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0053]: method `foo` has an incompatible type for trait - --> $DIR/dont-project-to-specializable-projection.rs:16:35 - | -LL | default async fn foo(_: T) -> &'static str { - | ^^^^^^^^^^^^ expected associated type, found future - | -note: type in trait - --> $DIR/dont-project-to-specializable-projection.rs:12:27 - | -LL | async fn foo(_: T) -> &'static str; - | ^^^^^^^^^^^^ - = note: expected signature `fn(_) -> impl Future` - found signature `fn(_) -> impl Future` - -error: async associated function in trait cannot be specialized - --> $DIR/dont-project-to-specializable-projection.rs:16:5 - | -LL | default async fn foo(_: T) -> &'static str { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs index 7183eaccc..afd3db5e0 100644 --- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs +++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs @@ -1,7 +1,5 @@ // edition: 2021 // known-bug: #108309 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(min_specialization)] diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr new file mode 100644 index 000000000..7c750bf51 --- /dev/null +++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr @@ -0,0 +1,25 @@ +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/dont-project-to-specializable-projection.rs:14:35 + | +LL | default async fn foo(_: T) -> &'static str { + | ^^^^^^^^^^^^ expected associated type, found future + | +note: type in trait + --> $DIR/dont-project-to-specializable-projection.rs:10:27 + | +LL | async fn foo(_: T) -> &'static str; + | ^^^^^^^^^^^^ + = note: expected signature `fn(_) -> impl Future` + found signature `fn(_) -> impl Future` + +error: async associated function in trait cannot be specialized + --> $DIR/dont-project-to-specializable-projection.rs:14:5 + | +LL | default async fn foo(_: T) -> &'static str { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/early-bound-1.rs b/tests/ui/async-await/in-trait/early-bound-1.rs index 30843473d..6b3b14201 100644 --- a/tests/ui/async-await/in-trait/early-bound-1.rs +++ b/tests/ui/async-await/in-trait/early-bound-1.rs @@ -1,7 +1,5 @@ // check-pass // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/early-bound-2.rs b/tests/ui/async-await/in-trait/early-bound-2.rs index 1c5a68c2a..270443229 100644 --- a/tests/ui/async-await/in-trait/early-bound-2.rs +++ b/tests/ui/async-await/in-trait/early-bound-2.rs @@ -1,7 +1,5 @@ // check-pass // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr b/tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr deleted file mode 100644 index 1a7495149..000000000 --- a/tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types - --> $DIR/fn-not-async-err2.rs:15:22 - | -LL | fn foo(&self) -> impl Future { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0562`. diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr b/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr deleted file mode 100644 index 1a7495149..000000000 --- a/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types - --> $DIR/fn-not-async-err2.rs:15:22 - | -LL | fn foo(&self) -> impl Future { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0562`. diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.rs b/tests/ui/async-await/in-trait/fn-not-async-err2.rs index 5fdb7296a..78017429f 100644 --- a/tests/ui/async-await/in-trait/fn-not-async-err2.rs +++ b/tests/ui/async-await/in-trait/fn-not-async-err2.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.stderr b/tests/ui/async-await/in-trait/fn-not-async-err2.stderr new file mode 100644 index 000000000..37d9669c0 --- /dev/null +++ b/tests/ui/async-await/in-trait/fn-not-async-err2.stderr @@ -0,0 +1,12 @@ +error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types + --> $DIR/fn-not-async-err2.rs:13:22 + | +LL | fn foo(&self) -> impl Future { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0562`. diff --git a/tests/ui/async-await/in-trait/generics-mismatch.current.stderr b/tests/ui/async-await/in-trait/generics-mismatch.current.stderr deleted file mode 100644 index be23384e0..000000000 --- a/tests/ui/async-await/in-trait/generics-mismatch.current.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo` - --> $DIR/generics-mismatch.rs:13:18 - | -LL | trait Foo { - | --- -LL | async fn foo(); - | - expected type parameter -... -LL | impl Foo for () { - | --------------- -LL | async fn foo() {} - | ^^^^^^^^^^^^^^ found const parameter of type `usize` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/generics-mismatch.next.stderr b/tests/ui/async-await/in-trait/generics-mismatch.next.stderr deleted file mode 100644 index be23384e0..000000000 --- a/tests/ui/async-await/in-trait/generics-mismatch.next.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo` - --> $DIR/generics-mismatch.rs:13:18 - | -LL | trait Foo { - | --- -LL | async fn foo(); - | - expected type parameter -... -LL | impl Foo for () { - | --------------- -LL | async fn foo() {} - | ^^^^^^^^^^^^^^ found const parameter of type `usize` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/async-await/in-trait/implied-bounds.rs b/tests/ui/async-await/in-trait/implied-bounds.rs index 45ada1d84..52bceb3cc 100644 --- a/tests/ui/async-await/in-trait/implied-bounds.rs +++ b/tests/ui/async-await/in-trait/implied-bounds.rs @@ -1,7 +1,5 @@ // check-pass // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/issue-102138.rs b/tests/ui/async-await/in-trait/issue-102138.rs index ced30b7e4..f61b34ed9 100644 --- a/tests/ui/async-await/in-trait/issue-102138.rs +++ b/tests/ui/async-await/in-trait/issue-102138.rs @@ -1,7 +1,5 @@ // check-pass // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/issue-102219.rs b/tests/ui/async-await/in-trait/issue-102219.rs index f3fdfa345..9a35f6515 100644 --- a/tests/ui/async-await/in-trait/issue-102219.rs +++ b/tests/ui/async-await/in-trait/issue-102219.rs @@ -1,8 +1,6 @@ // compile-flags:--crate-type=lib // edition:2021 // check-pass -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/issue-102310.rs b/tests/ui/async-await/in-trait/issue-102310.rs index 8e5dbd08e..49c3e9fee 100644 --- a/tests/ui/async-await/in-trait/issue-102310.rs +++ b/tests/ui/async-await/in-trait/issue-102310.rs @@ -1,7 +1,5 @@ // check-pass // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/issue-104678.rs b/tests/ui/async-await/in-trait/issue-104678.rs index 3d010f180..e396df4e5 100644 --- a/tests/ui/async-await/in-trait/issue-104678.rs +++ b/tests/ui/async-await/in-trait/issue-104678.rs @@ -1,7 +1,5 @@ // edition:2021 // check-pass -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr b/tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr deleted file mode 100644 index 69e7c65ee..000000000 --- a/tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration - --> $DIR/lifetime-mismatch.rs:13:17 - | -LL | async fn foo<'a>(&self); - | ---- lifetimes in impl do not match this method in trait -... -LL | async fn foo(&self) {} - | ^ lifetimes do not match method in trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0195`. diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr b/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr deleted file mode 100644 index 69e7c65ee..000000000 --- a/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration - --> $DIR/lifetime-mismatch.rs:13:17 - | -LL | async fn foo<'a>(&self); - | ---- lifetimes in impl do not match this method in trait -... -LL | async fn foo(&self) {} - | ^ lifetimes do not match method in trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0195`. diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.rs b/tests/ui/async-await/in-trait/lifetime-mismatch.rs index 46183f72b..bb793df5d 100644 --- a/tests/ui/async-await/in-trait/lifetime-mismatch.rs +++ b/tests/ui/async-await/in-trait/lifetime-mismatch.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.stderr b/tests/ui/async-await/in-trait/lifetime-mismatch.stderr new file mode 100644 index 000000000..86592269c --- /dev/null +++ b/tests/ui/async-await/in-trait/lifetime-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration + --> $DIR/lifetime-mismatch.rs:11:17 + | +LL | async fn foo<'a>(&self); + | ---- lifetimes in impl do not match this method in trait +... +LL | async fn foo(&self) {} + | ^ lifetimes do not match method in trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0195`. diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr deleted file mode 100644 index e6ac9bc22..000000000 --- a/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0046]: not all trait items implemented, missing: `foo` - --> $DIR/missing-feature-flag.rs:14:1 - | -LL | async fn foo(_: T) -> &'static str; - | ----------------------------------- `foo` from trait -... -LL | impl MyTrait for MyStruct {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation - -error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` - --> $DIR/missing-feature-flag.rs:18:5 - | -LL | impl MyTrait for MyStruct {} - | ------------------------------- parent `impl` is here -... -LL | async fn foo(_: i32) -> &'static str {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` - | - = note: to specialize, `foo` in the parent `impl` must be marked `default` - -error[E0308]: mismatched types - --> $DIR/missing-feature-flag.rs:18:42 - | -LL | async fn foo(_: i32) -> &'static str {} - | ^^ expected `&str`, found `()` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0046, E0308, E0520. -For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr deleted file mode 100644 index e6ac9bc22..000000000 --- a/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0046]: not all trait items implemented, missing: `foo` - --> $DIR/missing-feature-flag.rs:14:1 - | -LL | async fn foo(_: T) -> &'static str; - | ----------------------------------- `foo` from trait -... -LL | impl MyTrait for MyStruct {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation - -error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` - --> $DIR/missing-feature-flag.rs:18:5 - | -LL | impl MyTrait for MyStruct {} - | ------------------------------- parent `impl` is here -... -LL | async fn foo(_: i32) -> &'static str {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` - | - = note: to specialize, `foo` in the parent `impl` must be marked `default` - -error[E0308]: mismatched types - --> $DIR/missing-feature-flag.rs:18:42 - | -LL | async fn foo(_: i32) -> &'static str {} - | ^^ expected `&str`, found `()` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0046, E0308, E0520. -For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.rs b/tests/ui/async-await/in-trait/missing-feature-flag.rs index 6481f4a70..34dd50a1c 100644 --- a/tests/ui/async-await/in-trait/missing-feature-flag.rs +++ b/tests/ui/async-await/in-trait/missing-feature-flag.rs @@ -1,6 +1,4 @@ // edition:2018 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] #![feature(min_specialization)] diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.stderr new file mode 100644 index 000000000..f6aba1fcd --- /dev/null +++ b/tests/ui/async-await/in-trait/missing-feature-flag.stderr @@ -0,0 +1,30 @@ +error[E0046]: not all trait items implemented, missing: `foo` + --> $DIR/missing-feature-flag.rs:12:1 + | +LL | async fn foo(_: T) -> &'static str; + | ----------------------------------- `foo` from trait +... +LL | impl MyTrait for MyStruct {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation + +error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/missing-feature-flag.rs:16:5 + | +LL | impl MyTrait for MyStruct {} + | ------------------------------- parent `impl` is here +... +LL | async fn foo(_: i32) -> &'static str {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` + | + = note: to specialize, `foo` in the parent `impl` must be marked `default` + +error[E0308]: mismatched types + --> $DIR/missing-feature-flag.rs:16:42 + | +LL | async fn foo(_: i32) -> &'static str {} + | ^^ expected `&str`, found `()` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0046, E0308, E0520. +For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/async-await/in-trait/missing-send-bound.current.stderr b/tests/ui/async-await/in-trait/missing-send-bound.current.stderr deleted file mode 100644 index 9aa37f743..000000000 --- a/tests/ui/async-await/in-trait/missing-send-bound.current.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/missing-send-bound.rs:16:20 - | -LL | assert_is_send(test::()); - | ^^^^^^^^^^^ future returned by `test` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `impl Future` -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/missing-send-bound.rs:12:5 - | -LL | T::bar().await; - | ^^^^^^^^ await occurs here on type `impl Future`, which is not `Send` -note: required by a bound in `assert_is_send` - --> $DIR/missing-send-bound.rs:20:27 - | -LL | fn assert_is_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_is_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/missing-send-bound.next.stderr b/tests/ui/async-await/in-trait/missing-send-bound.next.stderr deleted file mode 100644 index 9aa37f743..000000000 --- a/tests/ui/async-await/in-trait/missing-send-bound.next.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/missing-send-bound.rs:16:20 - | -LL | assert_is_send(test::()); - | ^^^^^^^^^^^ future returned by `test` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `impl Future` -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/missing-send-bound.rs:12:5 - | -LL | T::bar().await; - | ^^^^^^^^ await occurs here on type `impl Future`, which is not `Send` -note: required by a bound in `assert_is_send` - --> $DIR/missing-send-bound.rs:20:27 - | -LL | fn assert_is_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_is_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/in-trait/missing-send-bound.rs b/tests/ui/async-await/in-trait/missing-send-bound.rs index b602865cb..dbcc66576 100644 --- a/tests/ui/async-await/in-trait/missing-send-bound.rs +++ b/tests/ui/async-await/in-trait/missing-send-bound.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/missing-send-bound.stderr b/tests/ui/async-await/in-trait/missing-send-bound.stderr new file mode 100644 index 000000000..18185b755 --- /dev/null +++ b/tests/ui/async-await/in-trait/missing-send-bound.stderr @@ -0,0 +1,20 @@ +error: future cannot be sent between threads safely + --> $DIR/missing-send-bound.rs:14:20 + | +LL | assert_is_send(test::()); + | ^^^^^^^^^^^ future returned by `test` is not `Send` + | + = help: within `impl Future`, the trait `Send` is not implemented for `impl Future` +note: future is not `Send` as it awaits another future which is not `Send` + --> $DIR/missing-send-bound.rs:10:5 + | +LL | T::bar().await; + | ^^^^^^^^ await occurs here on type `impl Future`, which is not `Send` +note: required by a bound in `assert_is_send` + --> $DIR/missing-send-bound.rs:18:27 + | +LL | fn assert_is_send(_: impl Send) {} + | ^^^^ required by this bound in `assert_is_send` + +error: aborting due to previous error + diff --git a/tests/ui/async-await/in-trait/object-safety.current.stderr b/tests/ui/async-await/in-trait/object-safety.current.stderr deleted file mode 100644 index 7f7ec3914..000000000 --- a/tests/ui/async-await/in-trait/object-safety.current.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/object-safety.rs:12:12 - | -LL | let x: &dyn Foo = todo!(); - | ^^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/object-safety.rs:8:14 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | async fn foo(&self); - | ^^^ ...because method `foo` is `async` - = help: consider moving `foo` to another trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/async-await/in-trait/object-safety.next.stderr b/tests/ui/async-await/in-trait/object-safety.next.stderr deleted file mode 100644 index 7f7ec3914..000000000 --- a/tests/ui/async-await/in-trait/object-safety.next.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/object-safety.rs:12:12 - | -LL | let x: &dyn Foo = todo!(); - | ^^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/object-safety.rs:8:14 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | async fn foo(&self); - | ^^^ ...because method `foo` is `async` - = help: consider moving `foo` to another trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/async-await/in-trait/object-safety.rs b/tests/ui/async-await/in-trait/object-safety.rs index 4edad1512..441539e5d 100644 --- a/tests/ui/async-await/in-trait/object-safety.rs +++ b/tests/ui/async-await/in-trait/object-safety.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/object-safety.stderr b/tests/ui/async-await/in-trait/object-safety.stderr new file mode 100644 index 000000000..ccdf9d887 --- /dev/null +++ b/tests/ui/async-await/in-trait/object-safety.stderr @@ -0,0 +1,18 @@ +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/object-safety.rs:10:12 + | +LL | let x: &dyn Foo = todo!(); + | ^^^^^^^^ `Foo` cannot be made into an object + | +note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit + --> $DIR/object-safety.rs:6:14 + | +LL | trait Foo { + | --- this trait cannot be made into an object... +LL | async fn foo(&self); + | ^^^ ...because method `foo` is `async` + = help: consider moving `foo` to another trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr deleted file mode 100644 index 56973a1d1..000000000 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0726]: implicit elided lifetime not allowed here - --> $DIR/return-not-existing-pair.rs:12:20 - | -LL | impl<'a, 'b, T, U> MyTrait for U { - | ^^^^^^^^^^ expected lifetime parameters - | -help: indicate the anonymous lifetimes - | -LL | impl<'a, 'b, T, U> MyTrait<'_, '_, T> for U { - | +++++++ - -error[E0412]: cannot find type `ConnImpl` in this scope - --> $DIR/return-not-existing-pair.rs:8:48 - | -LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - | ^^^^^^^^ not found in this scope - -error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl - --> $DIR/return-not-existing-pair.rs:14:5 - | -LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - | ------------------------------------------------------------ `&self` used in trait -... -LL | async fn foo(_: T) -> (&'a U, &'b T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl - -error[E0308]: mismatched types - --> $DIR/return-not-existing-pair.rs:14:42 - | -LL | async fn foo(_: T) -> (&'a U, &'b T) {} - | ^^ expected `(&U, &T)`, found `()` - | - = note: expected tuple `(&'a U, &'b T)` - found unit type `()` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0186, E0308, E0412, E0726. -For more information about an error, try `rustc --explain E0186`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr deleted file mode 100644 index 56973a1d1..000000000 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0726]: implicit elided lifetime not allowed here - --> $DIR/return-not-existing-pair.rs:12:20 - | -LL | impl<'a, 'b, T, U> MyTrait for U { - | ^^^^^^^^^^ expected lifetime parameters - | -help: indicate the anonymous lifetimes - | -LL | impl<'a, 'b, T, U> MyTrait<'_, '_, T> for U { - | +++++++ - -error[E0412]: cannot find type `ConnImpl` in this scope - --> $DIR/return-not-existing-pair.rs:8:48 - | -LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - | ^^^^^^^^ not found in this scope - -error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl - --> $DIR/return-not-existing-pair.rs:14:5 - | -LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - | ------------------------------------------------------------ `&self` used in trait -... -LL | async fn foo(_: T) -> (&'a U, &'b T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl - -error[E0308]: mismatched types - --> $DIR/return-not-existing-pair.rs:14:42 - | -LL | async fn foo(_: T) -> (&'a U, &'b T) {} - | ^^ expected `(&U, &T)`, found `()` - | - = note: expected tuple `(&'a U, &'b T)` - found unit type `()` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0186, E0308, E0412, E0726. -For more information about an error, try `rustc --explain E0186`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.rs b/tests/ui/async-await/in-trait/return-not-existing-pair.rs index d1b3832d1..a14dfceed 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.stderr new file mode 100644 index 000000000..e573b8517 --- /dev/null +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.stderr @@ -0,0 +1,39 @@ +error[E0726]: implicit elided lifetime not allowed here + --> $DIR/return-not-existing-pair.rs:10:20 + | +LL | impl<'a, 'b, T, U> MyTrait for U { + | ^^^^^^^^^^ expected lifetime parameters + | +help: indicate the anonymous lifetimes + | +LL | impl<'a, 'b, T, U> MyTrait<'_, '_, T> for U { + | +++++++ + +error[E0412]: cannot find type `ConnImpl` in this scope + --> $DIR/return-not-existing-pair.rs:6:48 + | +LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); + | ^^^^^^^^ not found in this scope + +error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl + --> $DIR/return-not-existing-pair.rs:12:5 + | +LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); + | ------------------------------------------------------------ `&self` used in trait +... +LL | async fn foo(_: T) -> (&'a U, &'b T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl + +error[E0308]: mismatched types + --> $DIR/return-not-existing-pair.rs:12:42 + | +LL | async fn foo(_: T) -> (&'a U, &'b T) {} + | ^^ expected `(&U, &T)`, found `()` + | + = note: expected tuple `(&'a U, &'b T)` + found unit type `()` + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0186, E0308, E0412, E0726. +For more information about an error, try `rustc --explain E0186`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr deleted file mode 100644 index 2564d68d5..000000000 --- a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `Missing` in this scope - --> $DIR/return-not-existing-type-wrapping-rpitit.rs:10:25 - | -LL | fn bar() -> Wrapper>; - | ^^^^^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr deleted file mode 100644 index 2564d68d5..000000000 --- a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `Missing` in this scope - --> $DIR/return-not-existing-type-wrapping-rpitit.rs:10:25 - | -LL | fn bar() -> Wrapper>; - | ^^^^^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs index 37c02827e..254b9a782 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs @@ -1,6 +1,4 @@ // edition:2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(return_position_impl_trait_in_trait)] diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.stderr b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.stderr new file mode 100644 index 000000000..059934d24 --- /dev/null +++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `Missing` in this scope + --> $DIR/return-not-existing-type-wrapping-rpitit.rs:8:25 + | +LL | fn bar() -> Wrapper>; + | ^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.current.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.current.stderr deleted file mode 100644 index 6a107d7be..000000000 --- a/tests/ui/async-await/in-trait/return-type-suggestion.current.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/return-type-suggestion.rs:9:9 - | -LL | Ok(()) - | ^^^^^^- help: consider using a semicolon here: `;` - | | - | expected `()`, found `Result<(), _>` - | - = note: expected unit type `()` - found enum `Result<(), _>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr deleted file mode 100644 index 6a107d7be..000000000 --- a/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/return-type-suggestion.rs:9:9 - | -LL | Ok(()) - | ^^^^^^- help: consider using a semicolon here: `;` - | | - | expected `()`, found `Result<(), _>` - | - = note: expected unit type `()` - found enum `Result<(), _>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.rs b/tests/ui/async-await/in-trait/return-type-suggestion.rs index d63bccefa..cdab4ea0f 100644 --- a/tests/ui/async-await/in-trait/return-type-suggestion.rs +++ b/tests/ui/async-await/in-trait/return-type-suggestion.rs @@ -1,6 +1,4 @@ // edition: 2021 -// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty -// revisions: current next #![feature(async_fn_in_trait)] @@ -8,7 +6,6 @@ trait A { async fn e() { Ok(()) //~^ ERROR mismatched types - //~| HELP consider using a semicolon here } } diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.stderr new file mode 100644 index 000000000..179c9ed93 --- /dev/null +++ b/tests/ui/async-await/in-trait/return-type-suggestion.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/return-type-suggestion.rs:7:9 + | +LL | Ok(()) + | ^^^^^^ expected `()`, found `Result<(), _>` + | + = note: expected unit type `()` + found enum `Result<(), _>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. -- cgit v1.2.3