rust/compiler/rustc_ast
Nicholas Nethercote fd91925bce Add `ErrorGuaranteed` to `Recovered::Yes` and use it more.
The starting point for this was identical comments on two different
fields, in `ast::VariantData::Struct` and `hir::VariantData::Struct`:
```
    // FIXME: investigate making this a `Option<ErrorGuaranteed>`
    recovered: bool
```
I tried that, and then found that I needed to add an `ErrorGuaranteed`
to `Recovered::Yes`. Then I ended up using `Recovered` instead of
`Option<ErrorGuaranteed>` for these two places and elsewhere, which
required moving `ErrorGuaranteed` from `rustc_parse` to `rustc_ast`.

This makes things more consistent, because `Recovered` is used in more
places, and there are fewer uses of `bool` and
`Option<ErrorGuaranteed>`. And safer, because it's difficult/impossible
to set `recovered` to `Recovered::Yes` without having emitted an error.
2024-05-09 20:12:07 +10:00
..
src Add `ErrorGuaranteed` to `Recovered::Yes` and use it more. 2024-05-09 20:12:07 +10:00
Cargo.toml Split rustc_type_ir to avoid rustc_ast from depending on it 2024-02-27 18:11:23 +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: