about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-02-10 14:15:20 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-03-28 16:29:31 +0000
commitf42a6793ce3d32a8d414519b8ec82141f7996479 (patch)
treebfbbee5424d8baeed75140f9eee996304d6aeeea
parent264cd05b16198c2838ec6cd585bd122491e3f7a9 (diff)
downloadrust-f42a6793ce3d32a8d414519b8ec82141f7996479.tar.gz
rust-f42a6793ce3d32a8d414519b8ec82141f7996479.zip
Fail more aggressively
-rw-r--r--compiler/rustc_trait_selection/src/traits/codegen.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs
index 22182faa0c6..4b6784aee97 100644
--- a/compiler/rustc_trait_selection/src/traits/codegen.rs
+++ b/compiler/rustc_trait_selection/src/traits/codegen.rs
@@ -92,10 +92,11 @@ pub fn codegen_fulfill_obligation<'tcx>(
         });
         let impl_source = drain_fulfillment_cx_or_panic(&infcx, &mut fulfill_cx, impl_source);
 
-        // We may constrain the hidden types of opaque types in this query, but this is
-        // not information our callers need, as all that information is handled by borrowck
-        // and typeck.
-        drop(infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types());
+        // There should be no opaque types during codegen, they all get revealed.
+        let opaque_types = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
+        if !opaque_types.is_empty() {
+            bug!("{:#?}", opaque_types);
+        }
 
         debug!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
         Ok(&*tcx.arena.alloc(impl_source))