1
Fork 0

rename is_tainted_by_errors

This commit is contained in:
Boxy 2022-11-18 10:25:32 +00:00
parent 3fca95a597
commit 1c48039a87
13 changed files with 42 additions and 33 deletions

View file

@ -2294,9 +2294,13 @@ mod error {
}
pub fn buffer_error(&mut self, t: DiagnosticBuilder<'_, ErrorGuaranteed>) {
self.tainted_by_errors = Some(
self.tcx.sess.delay_span_bug(t.span.clone(), "diagnostic buffered but not emitted"),
);
if let None = self.tainted_by_errors {
self.tainted_by_errors = Some(
self.tcx
.sess
.delay_span_bug(t.span.clone(), "diagnostic buffered but not emitted"),
)
}
t.buffer(&mut self.buffered);
}

View file

@ -219,7 +219,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
instantiated_ty: OpaqueHiddenType<'tcx>,
origin: OpaqueTyOrigin,
) -> Ty<'tcx> {
if let Some(e) = self.is_tainted_by_errors() {
if let Some(e) = self.tainted_by_errors() {
return self.tcx.ty_error_with_guaranteed(e);
}