diff options
| author | bors <bors@rust-lang.org> | 2023-11-09 00:39:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-09 00:39:02 +0000 |
| commit | d8dbf7ca0ee9c6da0fd039b1eb8cf7c7cb840f43 (patch) | |
| tree | b1e123bc35822df83b2bdb9fed750ac2c3996596 /compiler/rustc_data_structures/src/lib.rs | |
| parent | 57fb1e643aa96da3c7024ff5a45859647f39ad5b (diff) | |
| parent | ff1858e2aa4c7ff60ae72ec7d90973a7a14b94f9 (diff) | |
| download | rust-d8dbf7ca0ee9c6da0fd039b1eb8cf7c7cb840f43.tar.gz rust-d8dbf7ca0ee9c6da0fd039b1eb8cf7c7cb840f43.zip | |
Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov
Make `FatalErrorMarker` lower priority than other panics This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs. This fixes https://github.com/rust-lang/rust/issues/116659.
Diffstat (limited to 'compiler/rustc_data_structures/src/lib.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 5d7f385c6e4..d09c026c4b4 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -127,6 +127,9 @@ impl<F: FnOnce()> Drop for OnDrop<F> { } } +/// This is a marker for a fatal compiler error used with `resume_unwind`. +pub struct FatalErrorMarker; + /// Turns a closure that takes an `&mut Formatter` into something that can be display-formatted. pub fn make_display(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl fmt::Display { struct Printer<F> { |
