Mark ErrorGuaranteed constructor as deprecated so people don't use it

This commit is contained in:
Michael Goulet 2023-05-05 17:31:54 +00:00
parent 82cd953c7c
commit 6077fdd219
6 changed files with 35 additions and 16 deletions

View file

@ -1178,6 +1178,7 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorGuaranteed> {
catch_unwind(panic::AssertUnwindSafe(f)).map_err(|value| {
if value.is::<rustc_errors::FatalErrorMarker>() {
#[allow(deprecated)]
ErrorGuaranteed::unchecked_claim_error_was_emitted()
} else {
panic::resume_unwind(value);