Rename unchecked_claim_error_was_emitted as unchecked_error_guaranteed.

It's more to-the-point.
This commit is contained in:
Nicholas Nethercote 2024-02-07 19:30:59 +11:00
parent 97c157fe1e
commit 6889fe3806
2 changed files with 6 additions and 6 deletions

View File

@ -933,7 +933,7 @@ pub fn has_errors(&self) -> Option<ErrorGuaranteed> {
self.inner.borrow().has_errors().then(|| {
// FIXME(nnethercote) find a way to store an `ErrorGuaranteed`.
#[allow(deprecated)]
ErrorGuaranteed::unchecked_claim_error_was_emitted()
ErrorGuaranteed::unchecked_error_guaranteed()
})
}
@ -945,7 +945,7 @@ pub fn has_errors_or_lint_errors(&self) -> Option<ErrorGuaranteed> {
result.then(|| {
// FIXME(nnethercote) find a way to store an `ErrorGuaranteed`.
#[allow(deprecated)]
ErrorGuaranteed::unchecked_claim_error_was_emitted()
ErrorGuaranteed::unchecked_error_guaranteed()
})
}
@ -958,7 +958,7 @@ pub fn has_errors_or_lint_errors_or_delayed_bugs(&self) -> Option<ErrorGuarantee
result.then(|| {
// FIXME(nnethercote) find a way to store an `ErrorGuaranteed`.
#[allow(deprecated)]
ErrorGuaranteed::unchecked_claim_error_was_emitted()
ErrorGuaranteed::unchecked_error_guaranteed()
})
}
@ -1286,7 +1286,7 @@ fn emit_diagnostic(&mut self, mut diagnostic: Diagnostic) -> Option<ErrorGuarant
let backtrace = std::backtrace::Backtrace::capture();
self.delayed_bugs.push(DelayedDiagnostic::with_backtrace(diagnostic, backtrace));
#[allow(deprecated)]
return Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
return Some(ErrorGuaranteed::unchecked_error_guaranteed());
}
GoodPathDelayedBug => {
let backtrace = std::backtrace::Backtrace::capture();
@ -1369,7 +1369,7 @@ fn emit_diagnostic(&mut self, mut diagnostic: Diagnostic) -> Option<ErrorGuarant
#[allow(deprecated)]
if level == Level::Error {
guaranteed = Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
guaranteed = Some(ErrorGuaranteed::unchecked_error_guaranteed());
}
});

View File

@ -2479,7 +2479,7 @@ fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
impl ErrorGuaranteed {
/// Don't use this outside of `DiagCtxtInner::emit_diagnostic`!
#[deprecated = "should only be used in `DiagCtxtInner::emit_diagnostic`"]
pub fn unchecked_claim_error_was_emitted() -> Self {
pub fn unchecked_error_guaranteed() -> Self {
ErrorGuaranteed(())
}
}