diff options
| author | bors <bors@rust-lang.org> | 2023-10-29 00:03:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-29 00:03:52 +0000 |
| commit | 2cad938a8173520f2bc39137b475f136be0aeeda (patch) | |
| tree | 668c1a104a33221cc0a6082cbe42e752d82690b3 /library/std/src/sys/unix/args.rs | |
| parent | e5cfc55477eceed1317a02189fdf77a4a98f2124 (diff) | |
| parent | eb66d10cc3a6947cad6b4b169ed86b8c07f464d3 (diff) | |
| download | rust-2cad938a8173520f2bc39137b475f136be0aeeda.tar.gz rust-2cad938a8173520f2bc39137b475f136be0aeeda.zip | |
Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errors
Implement `gen` blocks in the 2024 edition
Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122
`gen` block tracking issue https://github.com/rust-lang/rust/issues/117078
This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically.
An example usage of `gen` blocks is
```rust
fn foo() -> impl Iterator<Item = i32> {
gen {
yield 42;
for i in 5..18 {
if i.is_even() { continue }
yield i * 2;
}
}
}
```
The limitations (to be resolved) of the implementation are listed in the tracking issue
Diffstat (limited to 'library/std/src/sys/unix/args.rs')
0 files changed, 0 insertions, 0 deletions
