diff options
| author | bors <bors@rust-lang.org> | 2024-03-12 06:29:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-12 06:29:06 +0000 |
| commit | b0170b693ef91460c97ff9ea5e360888466611dd (patch) | |
| tree | 47d33e46031b7cfa4a3b11610b4cb57d44c4ac15 /compiler/rustc_errors/src | |
| parent | 0fa7feaf3f287b900176061053619c06306c67b0 (diff) | |
| parent | 39e00760eca3fd4e8ca2d796d815d8c85dbe99ad (diff) | |
| download | rust-b0170b693ef91460c97ff9ea5e360888466611dd.tar.gz rust-b0170b693ef91460c97ff9ea5e360888466611dd.zip | |
Auto merge of #122365 - matthiaskrgr:rollup-4i350h6, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #115141 (Update Windows platform support) - #121865 (Add FileCheck annotations to MIR-opt unnamed-fields tests) - #122000 (Fix 32-bit overflows in LLVM composite constants) - #122194 (Enable creating backtraces via -Ztreat-err-as-bug when stashing errors) - #122319 (Don't ICE when non-self part of trait goal is constrained in new solver) - #122339 (Update books) - #122342 (Update /NODEFAUTLIB comment for msvc) - #122343 (Remove some unnecessary `allow(incomplete_features)` in the test suite) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 11 |
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, |
