]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/codegen.rs
Auto merge of #94105 - 5225225:destabilise-entry-insert, r=Mark-Simulacrum
[rust.git] / compiler / rustc_trait_selection / src / traits / codegen.rs
index 138d535a5694de88537ec80c80a02b91bdc96fc7..bf6e6a4fcbb9d9e0d70bd3601712e367b19bf111 100644 (file)
@@ -64,6 +64,8 @@ pub fn codegen_fulfill_obligation<'tcx>(
             Err(Unimplemented) => {
                 // This can trigger when we probe for the source of a `'static` lifetime requirement
                 // on a trait object: `impl Foo for dyn Trait {}` has an implicit `'static` bound.
+                // This can also trigger when we have a global bound that is not actually satisfied,
+                // but was included during typeck due to the trivial_bounds feature.
                 infcx.tcx.sess.delay_span_bug(
                     rustc_span::DUMMY_SP,
                     &format!(
@@ -90,11 +92,6 @@ 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());
-
         debug!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
         Ok(&*tcx.arena.alloc(impl_source))
     })