File tree 1 file changed +5
-0
lines changed
compiler/rustc_errors/src
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,8 @@ pub struct DiagCtxt {
418
418
#[ derive( Copy , Clone ) ]
419
419
pub struct DiagCtxtHandle < ' a > {
420
420
dcx : & ' a DiagCtxt ,
421
+ /// Some contexts create `DiagCtxtHandle` with this field set, and thus all
422
+ /// errors emitted with it will automatically taint when emitting errors.
421
423
tainted_with_errors : Option < & ' a Cell < Option < ErrorGuaranteed > > > ,
422
424
}
423
425
@@ -757,6 +759,9 @@ impl DiagCtxt {
757
759
DiagCtxtHandle { dcx : self , tainted_with_errors : None }
758
760
}
759
761
762
+ /// Link this to a taintable context so that emitting errors will automatically set
763
+ /// the `Option<ErrorGuaranteed>` instead of having to do that manually at every error
764
+ /// emission site.
760
765
pub fn taintable_handle < ' a > (
761
766
& ' a self ,
762
767
tainted_with_errors : & ' a Cell < Option < ErrorGuaranteed > > ,
You can’t perform that action at this time.
0 commit comments