rust/compiler/rustc_ast
bors 2cad938a81 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
2023-10-29 00:03:52 +00:00
..
src Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errors 2023-10-29 00:03:52 +00:00
Cargo.toml Uplift movability and mutability, the simple way 2023-10-19 16:42:58 +00:00
README.md docs(rustc_ast): update crate descriptions 2021-11-02 21:11:17 -05:00

README.md

The rustc_ast crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), along with some definitions for tokens and token streams, data structures/traits for mutating ASTs, and shared definitions for other AST-related parts of the compiler (like the lexer and macro-expansion).

For more information about how these things work in rustc, see the rustc dev guide: