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 | f2a0776f7713320c894a0649001f64f2b8504d39 (patch) | |
| tree | 091539bae2aba19260cddc7d291a8d85da68122e /compiler/rustc_interface/src/errors.rs | |
| parent | d736992ac9037726427fda9b1c2fc20d8574b4d5 (diff) | |
| parent | 0c8caee7b9a2bd5620e576459fac4b40aa5584b8 (diff) | |
| download | rust-f2a0776f7713320c894a0649001f64f2b8504d39.tar.gz rust-f2a0776f7713320c894a0649001f64f2b8504d39.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 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
