rust/src/librustc_error_codes/error_codes/E0727.md
2020-01-28 21:17:12 +01:00

404 B

A yield clause was used in an async context.

Example of erroneous code:

#![feature(generators)]

let generator = || {
    async {
        yield;
    }
};

Here, the yield keyword is used in an async block, which is not yet supported.

To fix this error, you have to move yield out of the async block:

#![feature(generators)]

let generator = || {
    yield;
};