about summary refs log tree commit diff
path: root/tests/coverage/coroutine.coverage
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-11 13:15:34 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-24 08:05:29 +0000
commitaef0f4024aec24fd7e53dbc51883457e44fe17ce (patch)
tree25a26930a8cc3441951ba159f1a632092df41655 /tests/coverage/coroutine.coverage
parenta589632dad58c2669b7984019efb59917a16ac67 (diff)
downloadrust-aef0f4024aec24fd7e53dbc51883457e44fe17ce.tar.gz
rust-aef0f4024aec24fd7e53dbc51883457e44fe17ce.zip
Error on using `yield` without also using `#[coroutine]` on the closure
And suggest adding the `#[coroutine]` to the closure
Diffstat (limited to 'tests/coverage/coroutine.coverage')
-rw-r--r--tests/coverage/coroutine.coverage4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/coverage/coroutine.coverage b/tests/coverage/coroutine.coverage
index bd3d4e46880..68b52d19831 100644
--- a/tests/coverage/coroutine.coverage
+++ b/tests/coverage/coroutine.coverage
@@ -1,4 +1,4 @@
-   LL|       |#![feature(coroutines, coroutine_trait)]
+   LL|       |#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
    LL|       |
    LL|       |use std::ops::{Coroutine, CoroutineState};
    LL|       |use std::pin::Pin;
@@ -18,7 +18,7 @@
    LL|       |
    LL|      1|fn main() {
    LL|      1|    let is_true = std::env::args().len() == 1;
-   LL|      1|    let mut coroutine = || {
+   LL|      1|    let mut coroutine = #[coroutine] || {
    LL|      1|        yield get_u32(is_true);
    LL|      1|        return "foo";
    LL|      1|    };