about summary refs log tree commit diff
path: root/tests/ui/async-await
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await')
-rw-r--r--tests/ui/async-await/generator-not-future.rs6
-rw-r--r--tests/ui/async-await/generator-not-future.stderr26
-rw-r--r--tests/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs2
3 files changed, 17 insertions, 17 deletions
diff --git a/tests/ui/async-await/generator-not-future.rs b/tests/ui/async-await/generator-not-future.rs
index 37d7cfa6fb7..a5b354021bd 100644
--- a/tests/ui/async-await/generator-not-future.rs
+++ b/tests/ui/async-await/generator-not-future.rs
@@ -2,20 +2,20 @@
 #![feature(generators, generator_trait)]
 
 use std::future::Future;
-use std::ops::Generator;
+use std::ops::Coroutine;
 
 async fn async_fn() {}
 fn returns_async_block() -> impl Future<Output = ()> {
     async {}
 }
-fn returns_generator() -> impl Generator<(), Yield = (), Return = ()> {
+fn returns_generator() -> impl Coroutine<(), Yield = (), Return = ()> {
     || {
         let _: () = yield ();
     }
 }
 
 fn takes_future(_f: impl Future<Output = ()>) {}
-fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {}
+fn takes_generator<ResumeTy>(_g: impl Coroutine<ResumeTy, Yield = (), Return = ()>) {}
 
 fn main() {
     // okay:
diff --git a/tests/ui/async-await/generator-not-future.stderr b/tests/ui/async-await/generator-not-future.stderr
index 540501b9826..3fd11b0a269 100644
--- a/tests/ui/async-await/generator-not-future.stderr
+++ b/tests/ui/async-await/generator-not-future.stderr
@@ -1,55 +1,55 @@
-error[E0277]: the trait bound `impl Future<Output = ()>: Generator<_>` is not satisfied
+error[E0277]: the trait bound `impl Future<Output = ()>: Coroutine<_>` is not satisfied
   --> $DIR/generator-not-future.rs:31:21
    |
 LL |     takes_generator(async_fn());
-   |     --------------- ^^^^^^^^^^ the trait `Generator<_>` is not implemented for `impl Future<Output = ()>`
+   |     --------------- ^^^^^^^^^^ the trait `Coroutine<_>` is not implemented for `impl Future<Output = ()>`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `takes_generator`
   --> $DIR/generator-not-future.rs:18:39
    |
-LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {}
+LL | fn takes_generator<ResumeTy>(_g: impl Coroutine<ResumeTy, Yield = (), Return = ()>) {}
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator`
 
-error[E0277]: the trait bound `impl Future<Output = ()>: Generator<_>` is not satisfied
+error[E0277]: the trait bound `impl Future<Output = ()>: Coroutine<_>` is not satisfied
   --> $DIR/generator-not-future.rs:33:21
    |
 LL |     takes_generator(returns_async_block());
-   |     --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `Generator<_>` is not implemented for `impl Future<Output = ()>`
+   |     --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine<_>` is not implemented for `impl Future<Output = ()>`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `takes_generator`
   --> $DIR/generator-not-future.rs:18:39
    |
-LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {}
+LL | fn takes_generator<ResumeTy>(_g: impl Coroutine<ResumeTy, Yield = (), Return = ()>) {}
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator`
 
-error[E0277]: the trait bound `{async block@$DIR/generator-not-future.rs:35:21: 35:29}: Generator<_>` is not satisfied
+error[E0277]: the trait bound `{async block@$DIR/generator-not-future.rs:35:21: 35:29}: Coroutine<_>` is not satisfied
   --> $DIR/generator-not-future.rs:35:21
    |
 LL |     takes_generator(async {});
-   |     --------------- ^^^^^^^^ the trait `Generator<_>` is not implemented for `{async block@$DIR/generator-not-future.rs:35:21: 35:29}`
+   |     --------------- ^^^^^^^^ the trait `Coroutine<_>` is not implemented for `{async block@$DIR/generator-not-future.rs:35:21: 35:29}`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `takes_generator`
   --> $DIR/generator-not-future.rs:18:39
    |
-LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {}
+LL | fn takes_generator<ResumeTy>(_g: impl Coroutine<ResumeTy, Yield = (), Return = ()>) {}
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator`
 
-error[E0277]: `impl Generator<Yield = (), Return = ()>` is not a future
+error[E0277]: `impl Coroutine<Yield = (), Return = ()>` is not a future
   --> $DIR/generator-not-future.rs:39:18
    |
 LL |     takes_future(returns_generator());
-   |     ------------ ^^^^^^^^^^^^^^^^^^^ `impl Generator<Yield = (), Return = ()>` is not a future
+   |     ------------ ^^^^^^^^^^^^^^^^^^^ `impl Coroutine<Yield = (), Return = ()>` is not a future
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the trait `Future` is not implemented for `impl Generator<Yield = (), Return = ()>`
-   = note: impl Generator<Yield = (), Return = ()> must be a future or must implement `IntoFuture` to be awaited
+   = help: the trait `Future` is not implemented for `impl Coroutine<Yield = (), Return = ()>`
+   = note: impl Coroutine<Yield = (), Return = ()> must be a future or must implement `IntoFuture` to be awaited
 note: required by a bound in `takes_future`
   --> $DIR/generator-not-future.rs:17:26
    |
diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs
index 9fc5667d684..2fd7823bd72 100644
--- a/tests/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs
+++ b/tests/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs
@@ -11,7 +11,7 @@
 #![feature(generators, generator_trait)]
 
 use std::{
-    ops::Generator,
+    ops::Coroutine,
     pin::Pin,
 };