about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-03-14 05:01:33 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-03-14 05:01:33 +0000
commit06ca3abc5ab06894fd2e15f78140eacccca3a5e9 (patch)
treeca240256a0323f4bbf16f86e7de5c1c78e47c98a /compiler/rustc_errors
parentf5bb34f4605bc83c02c2c0a7a128d706d6031f11 (diff)
parentac1b8575c017b6cc99cf389ceffe853d7b53a694 (diff)
downloadrust-06ca3abc5ab06894fd2e15f78140eacccca3a5e9.tar.gz
rust-06ca3abc5ab06894fd2e15f78140eacccca3a5e9.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_errors')
-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,