File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,8 @@ pub struct DiagCtxt {
418418#[ derive( Copy , Clone ) ]
419419pub struct DiagCtxtHandle < ' a > {
420420 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.
421423 tainted_with_errors : Option < & ' a Cell < Option < ErrorGuaranteed > > > ,
422424}
423425
@@ -757,6 +759,9 @@ impl DiagCtxt {
757759 DiagCtxtHandle { dcx : self , tainted_with_errors : None }
758760 }
759761
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.
760765 pub fn taintable_handle < ' a > (
761766 & ' a self ,
762767 tainted_with_errors : & ' a Cell < Option < ErrorGuaranteed > > ,
You can’t perform that action at this time.
0 commit comments