Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f42a679

Browse files
committed
Fail more aggressively
1 parent 264cd05 commit f42a679

File tree

1 file changed

+5
-4
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+5
-4
lines changed

compiler/rustc_trait_selection/src/traits/codegen.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ pub fn codegen_fulfill_obligation<'tcx>(
9292
});
9393
let impl_source = drain_fulfillment_cx_or_panic(&infcx, &mut fulfill_cx, impl_source);
9494

95-
// We may constrain the hidden types of opaque types in this query, but this is
96-
// not information our callers need, as all that information is handled by borrowck
97-
// and typeck.
98-
drop(infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types());
95+
// There should be no opaque types during codegen, they all get revealed.
96+
let opaque_types = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
97+
if !opaque_types.is_empty() {
98+
bug!("{:#?}", opaque_types);
99+
}
99100

100101
debug!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
101102
Ok(&*tcx.arena.alloc(impl_source))

0 commit comments

Comments
 (0)