From 40c6af01fa610c78b91e1552eae4c589b9b21a81 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 12 Feb 2024 16:24:15 +1100 Subject: [PATCH] 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. --- .../rustc_infer/src/infer/error_reporting/mod.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 4d2d19b51e22c..b953b25d6c4cf 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -132,20 +132,6 @@ pub struct TypeErrCtxt<'a, 'tcx> { Box) -> Vec<(Ty<'tcx>, Vec>)> + 'a>, } -impl Drop for TypeErrCtxt<'_, '_> { - fn drop(&mut self) { - if self.dcx().has_errors().is_some() { - // Ok, emitted an error. - } else { - // Didn't emit an error; maybe it was created but not yet emitted. - self.infcx - .tcx - .sess - .good_path_delayed_bug("used a `TypeErrCtxt` without raising an error or lint"); - } - } -} - impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { pub fn dcx(&self) -> &'tcx DiagCtxt { self.infcx.tcx.dcx()