1
Fork 0
rust/compiler/rustc_ast_lowering/src
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
..
asm.rs Change DefKind::Static to a struct variant 2024-03-12 05:53:46 +00:00
block.rs Rename hir::Local into hir::LetStmt 2024-03-22 20:36:21 +01:00
delegation.rs delegation: Support async, const, extern "ABI" and C-variadic functions 2024-04-23 23:05:39 +03:00
errors.rs Add a note to the ArbitraryExpressionInPattern error 2024-04-28 21:27:26 +02:00
expr.rs Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
format.rs Improve semantics of int_ty_max functions 2024-04-15 00:39:28 +05:30
index.rs Auto merge of #124401 - oli-obk:some_hir_cleanups, r=cjgillot 2024-05-04 00:32:27 +00:00
item.rs Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=Nilstrieb 2024-05-08 23:33:24 +02:00
lib.rs Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
lifetime_collector.rs Lower and resolve precise captures in HIR 2024-04-15 16:45:01 -04:00
pat.rs Add a note to the ArbitraryExpressionInPattern error 2024-04-28 21:27:26 +02:00
path.rs Remove extern crate tracing from numerous crates. 2024-04-30 16:47:49 +10:00