Skip to content

Commit 8d2b598

Browse files
committed
More sanity checks
1 parent f7abc1b commit 8d2b598

File tree

1 file changed

+7
-2
lines changed
  • compiler/rustc_infer/src/infer/opaque_types

1 file changed

+7
-2
lines changed

compiler/rustc_infer/src/infer/opaque_types/table.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use rustc_data_structures::fx::FxHashMap;
22
use rustc_data_structures::undo_log::UndoLogs;
3-
use rustc_middle::ty::{OpaqueTypeKey, Ty};
3+
use rustc_middle::ty::{self, OpaqueTypeKey, Ty};
4+
use rustc_span::DUMMY_SP;
45

56
use crate::infer::InferCtxtUndoLogs;
67

@@ -59,7 +60,11 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
5960

6061
impl<'tcx> Drop for OpaqueTypeStorage<'tcx> {
6162
fn drop(&mut self) {
62-
assert!(self.opaque_types.is_empty(), "{:?}", self.opaque_types);
63+
if !self.opaque_types.is_empty() {
64+
ty::tls::with(|tcx| {
65+
tcx.sess.delay_span_bug(DUMMY_SP, &format!("{:?}", self.opaque_types))
66+
});
67+
}
6368
}
6469
}
6570

0 commit comments

Comments
 (0)