Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with select/select_biased macro #96

Closed
kriomant opened this issue Feb 10, 2024 · 1 comment
Closed

Not compatible with select/select_biased macro #96

kriomant opened this issue Feb 10, 2024 · 1 comment

Comments

@kriomant
Copy link

use futures::select_biased;
use futures_async_stream::try_stream;

#[try_stream(ok=(), error=())]
pub async fn events(&mut self) {
    select_biased! {
         _ = futures::future::ready(()) => {}
    }
} 

gives

error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> src/rotary.rs:29:13
   |
25 |       #[try_stream(ok=(), error=())]
   |       ---------------------------------------------- this is not `async`
...
29 | /             select_biased! {
30 | |                 _ = futures::future::ready(()) => {}
31 | |             }
   | |_____________^ only allowed inside `async` functions and blocks
   |
   = note: this error originates in the macro `$crate::select_biased_internal` which comes from the expansion of the macro `select_biased` (in Nightly builds, run with -Z macro-backtrace for more info)
@taiki-e
Copy link
Owner

taiki-e commented Feb 10, 2024

This is a part of #4.

@taiki-e taiki-e closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants