Skip to content

Commit bd111f5

Browse files
committed
Document new field and function
1 parent ba198af commit bd111f5

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_errors/src

1 file changed

+5
-0
lines changed

compiler/rustc_errors/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ pub struct DiagCtxt {
418418
#[derive(Copy, Clone)]
419419
pub 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>>,

0 commit comments

Comments
 (0)