File tree 1 file changed +4
-7
lines changed
compiler/rustc_errors/src
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -768,13 +768,10 @@ impl DiagCtxt {
768
768
format ! ( "invalid level in `stash_diagnostic`: {:?}" , diag. level) ,
769
769
) ;
770
770
}
771
- Error => {
772
- // This `unchecked_error_guaranteed` is valid. It is where the
773
- // `ErrorGuaranteed` for stashed errors originates. See
774
- // `DiagCtxtInner::drop`.
775
- #[ allow( deprecated) ]
776
- Some ( ErrorGuaranteed :: unchecked_error_guaranteed ( ) )
777
- }
771
+ // We delay a bug here so that `-Ztreat-err-as-bug -Zeagerly-emit-delayed-bugs`
772
+ // can be used to create a backtrace at the stashing site insted of whenever the
773
+ // diagnostic context is dropped and thus delayed bugs are emitted.
774
+ Error => Some ( self . span_delayed_bug ( span, "stashing {key:?}" ) ) ,
778
775
DelayedBug => return self . inner . borrow_mut ( ) . emit_diagnostic ( diag) ,
779
776
ForceWarning ( _) | Warning | Note | OnceNote | Help | OnceHelp | FailureNote | Allow
780
777
| Expect ( _) => None ,
You can’t perform that action at this time.
0 commit comments