mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00

This adds an `iter!` macro that can be used to create movable generators. This also adds a yield_expr feature so the `yield` keyword can be used within iter! macro bodies. This was needed because several unstable features each need `yield` expressions, so this allows us to stabilize them separately from any individual feature. Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de> Co-authored-by: Jieyou Xu <jieyouxu@outlook.com> Co-authored-by: Travis Cross <tc@traviscross.com>
14 lines
356 B
Rust
14 lines
356 B
Rust
//@ edition:2024
|
|
|
|
#![feature(gen_blocks)]
|
|
|
|
const gen fn a() {}
|
|
//~^ ERROR functions cannot be both `const` and `gen`
|
|
//~^^ ERROR `gen` fn bodies are not allowed in constant functions
|
|
|
|
const async gen fn b() {}
|
|
//~^ ERROR functions cannot be both `const` and `async gen`
|
|
//~^^ ERROR `async gen` fn bodies are not allowed in constant functions
|
|
|
|
fn main() {}
|