Skip to content

Commit 7c7fcd8

Browse files
committed
Remove TypeErrCtxt::drop.
The check within changed from `delay_span_bug` to `delay_good_path_bug` in #110476, and removing the check altogether was considered. It's a very weak sanity check and gets in the way of removing good path delayed bugs altogether, so this PR just removes it.
1 parent a166af7 commit 7c7fcd8

File tree

1 file changed

+0
-14
lines changed
  • compiler/rustc_infer/src/infer/error_reporting

1 file changed

+0
-14
lines changed

compiler/rustc_infer/src/infer/error_reporting/mod.rs

-14
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,6 @@ pub struct TypeErrCtxt<'a, 'tcx> {
132132
Box<dyn Fn(Ty<'tcx>) -> Vec<(Ty<'tcx>, Vec<PredicateObligation<'tcx>>)> + 'a>,
133133
}
134134

135-
impl Drop for TypeErrCtxt<'_, '_> {
136-
fn drop(&mut self) {
137-
if self.dcx().has_errors().is_some() {
138-
// Ok, emitted an error.
139-
} else {
140-
// Didn't emit an error; maybe it was created but not yet emitted.
141-
self.infcx
142-
.tcx
143-
.sess
144-
.good_path_delayed_bug("used a `TypeErrCtxt` without raising an error or lint");
145-
}
146-
}
147-
}
148-
149135
impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
150136
pub fn dcx(&self) -> &'tcx DiagCtxt {
151137
self.infcx.tcx.dcx()

0 commit comments

Comments
 (0)