1
Fork 0

Rollup merge of #111261 - compiler-errors:error-guaranteed-should-be-scarier-to-construct, r=BoxyUwU

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

You should never ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever use this function unless you know what you're doing, so make it harder to accidentally use it!

Alternatives are to change the name to sound scarier, make it `unsafe` (though it's not really a soundness thing), or work on deeper refactors to make it private.

r? `@BoxyUwU`
This commit is contained in:
Yuki Okushi 2023-05-06 09:09:34 +09:00 committed by GitHub
commit 393e285e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 16 deletions

View file

@ -2199,6 +2199,7 @@ pub struct ErrorGuaranteed(());
impl ErrorGuaranteed {
/// To be used only if you really know what you are doing... ideally, we would find a way to
/// eliminate all calls to this method.
#[deprecated = "`Session::delay_span_bug` should be preferred over this function"]
pub fn unchecked_claim_error_was_emitted() -> Self {
ErrorGuaranteed(())
}