about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-12 16:24:15 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-13 08:34:42 +1100
commit173dbc9e13247290d2f69aed83e6e662e5a91136 (patch)
tree89caf245e5e30358cd65153794a2dd336cd3903c
parentb381d3ab27f788f990551100c4425bb782d26d76 (diff)
downloadrust-173dbc9e13247290d2f69aed83e6e662e5a91136.tar.gz
rust-173dbc9e13247290d2f69aed83e6e662e5a91136.zip
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.
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs14
1 files changed, 0 insertions, 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 4d2d19b51e2..b953b25d6c4 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<dyn Fn(Ty<'tcx>) -> Vec<(Ty<'tcx>, Vec<PredicateObligation<'tcx>>)> + '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()