rust/compiler/rustc_hir/src
Matthias Krüger 0a917f89f3
Rollup merge of #124919 - nnethercote:Recovered-Yes-ErrorGuaranteed, r=compiler-errors
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.

r? `@oli-obk`
2024-05-09 19:09:30 +02:00
..
arena.rs Remove unused arena kinds in rustc_hir and rustc_middle. 2023-11-20 15:05:26 +11:00
def_path_hash_map.rs Do not store stable crate id in on-disk hash map. 2023-12-24 17:22:48 +00:00
def.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
definitions.rs Remove extern crate tracing from numerous crates. 2024-04-30 16:47:49 +10:00
diagnostic_items.rs Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) 2023-12-18 21:03:32 +01:00
hir_id.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
hir.rs Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
intravisit.rs Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
lang_items.rs Remove enum_from_u32. 2024-05-09 09:01:59 +10:00
lib.rs Remove extern crate tracing from numerous crates. 2024-04-30 16:47:49 +10:00
pat_util.rs Rename BindingAnnotation to BindingMode 2024-04-17 09:34:39 -04:00
stable_hash_impls.rs Simplify BodyId hashing. 2024-01-16 23:52:30 +00:00
target.rs Change DefKind::Static to a struct variant 2024-03-12 05:53:46 +00:00
tests.rs Construct SourceMap at the same time as SessionGlobals. 2024-04-16 13:02:53 +10:00
weak_lang_items.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00