]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/mod.rs
Rollup merge of #94023 - krasimirgg:head-llvm-use-llvm-nm, r=Mark-Simulacrum
[rust.git] / compiler / rustc_typeck / src / check / mod.rs
index 5094806e75f4a36834667a86ad0dbacd1b3fab0f..6e0b902a00bda1014c19a4f0771d17fee2a9e0a2 100644 (file)
@@ -99,8 +99,6 @@
 pub use expectation::Expectation;
 pub use fn_ctxt::*;
 pub use inherited::{Inherited, InheritedBuilder};
-use rustc_infer::traits::ObligationCause;
-use traits::ObligationCauseCode::MiscObligation;
 
 use crate::astconv::AstConv;
 use crate::check::gather_locals::GatherLocalsVisitor;
@@ -343,7 +341,6 @@ fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::T
     typeck_with_fallback(tcx, def_id, fallback)
 }
 
-#[instrument(skip(tcx, fallback))]
 fn typeck_with_fallback<'tcx>(
     tcx: TyCtxt<'tcx>,
     def_id: LocalDefId,
@@ -474,19 +471,6 @@ fn typeck_with_fallback<'tcx>(
             fcx.require_type_is_sized(ty, span, code);
         }
 
-        let opaque_types = fcx.infcx.inner.borrow_mut().opaque_type_storage.opaque_types();
-        for (_, decl) in opaque_types {
-            let cause = ObligationCause::new(body.value.span, id, MiscObligation);
-            if let Err((err, expected, actual)) =
-                decl.hidden_type(&fcx.infcx, &cause, fcx.param_env)
-            {
-                let cause = ObligationCause::new(actual.span, id, MiscObligation);
-                fcx.report_mismatched_types(&cause, expected.ty, actual.ty, err)
-                    .span_label(expected.span, "type expected due to this")
-                    .emit();
-            }
-        }
-
         fcx.select_all_obligations_or_error();
 
         if fn_sig.is_some() {