Skip to content

std::r#await! macro cannot be used even if #![feature(await_macro)] is enabled #60660

Closed
@taiki-e

Description

@taiki-e

Code:

#![feature(async_await, await_macro)]

use std::r#await as std_await;

async fn foo() {}

async fn bar() {
    std_await!(foo())
}

Error:

error[E0658]: macro std_await! is unstable
 --> code\src\lib.rs:8:5
  |
8 |     std_await!(noop())
  |     ^^^^^^^^^^^^^^^^^^
  |
  = note: for more information, see https://github.com/rust-lang/rust/issues/50547
  = help: add #![feature(await_macro)] to the crate attributes to enable

error[E0727]: `async` generators are not yet supported
 --> code\src\lib.rs:7:16
  |
7 |   async fn foo() {
  |  ________________^
8 | |     std_await!(noop())
9 | | }
  | |_^

error: aborting due to 2 previous errors

Seems the second error relates to the fact that std::await is still defined using yield.

Rustc version: rustc 1.36.0-nightly (3f5152e 2019-05-08)

cc @cramertj

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions