about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-14 06:46:16 +0000
committerbors <bors@rust-lang.org>2024-03-14 06:46:16 +0000
commit24071bdf889d89052efcb3245c6de90a8899526e (patch)
treeeec550e91293d7ce0f751cfad6e41493186a515c /compiler/rustc_errors/src
parent34d6f07646e28977a2b7fb5c90202b6973c4441e (diff)
parent4cd673b4c6b6c633ea768b7d5ff1dbfead53c153 (diff)
downloadrust-24071bdf889d89052efcb3245c6de90a8899526e.tar.gz
rust-24071bdf889d89052efcb3245c6de90a8899526e.zip
Auto merge of #3378 - rust-lang:rustup-2024-03-14, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/lib.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index d4f884d49ea..286d4621850 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -769,13 +769,10 @@ impl DiagCtxt {
                     format!("invalid level in `stash_diagnostic`: {:?}", diag.level),
                 );
             }
-            Error => {
-                // This `unchecked_error_guaranteed` is valid. It is where the
-                // `ErrorGuaranteed` for stashed errors originates. See
-                // `DiagCtxtInner::drop`.
-                #[allow(deprecated)]
-                Some(ErrorGuaranteed::unchecked_error_guaranteed())
-            }
+            // We delay a bug here so that `-Ztreat-err-as-bug -Zeagerly-emit-delayed-bugs`
+            // can be used to create a backtrace at the stashing site insted of whenever the
+            // diagnostic context is dropped and thus delayed bugs are emitted.
+            Error => Some(self.span_delayed_bug(span, "stashing {key:?}")),
             DelayedBug => return self.inner.borrow_mut().emit_diagnostic(diag),
             ForceWarning(_) | Warning | Note | OnceNote | Help | OnceHelp | FailureNote | Allow
             | Expect(_) => None,