about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-01-26 07:53:25 +0100
committerGitHub <noreply@github.com>2023-01-26 07:53:25 +0100
commitc1d722c1cf6d1e497a042c0449ee7fdfcb18d2e6 (patch)
tree11cbffb7650a8e931f5ba74132cdbb73c701cff5
parentd667105681726fe84ef6256b8a75b2e770bed3e6 (diff)
parent0accf08e6b2b7a59147e9ca1c80ed969e82781fc (diff)
downloadrust-c1d722c1cf6d1e497a042c0449ee7fdfcb18d2e6.tar.gz
rust-c1d722c1cf6d1e497a042c0449ee7fdfcb18d2e6.zip
Rollup merge of #107074 - lcnr:validate-dont-skip-opaque, r=compiler-errors
remove unnecessary check for opaque types

this isn't needed and may hide some errors.

after analysis there are no opaque types so it's a noop anyways

before analysis there are opaque types but due to `Reveal::UserFacing` we don't reveal them. `is_subtype` simply discards the opaque type constraints as these will get checked again during mir borrowck.

r? types

want to land this after the beta-cutoff as mir validator changes are apparently pretty scary
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index dd168a9ac3c..3f83d40755a 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -13,7 +13,7 @@ use rustc_middle::mir::{
     ProjectionElem, RetagKind, RuntimePhase, Rvalue, SourceScope, Statement, StatementKind,
     Terminator, TerminatorKind, UnOp, START_BLOCK,
 };
-use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeVisitable};
+use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt};
 use rustc_mir_dataflow::impls::MaybeStorageLive;
 use rustc_mir_dataflow::storage::always_storage_live_locals;
 use rustc_mir_dataflow::{Analysis, ResultsCursor};
@@ -230,11 +230,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
             // Equal types, all is good.
             return true;
         }
-        // Normalization reveals opaque types, but we may be validating MIR while computing
-        // said opaque types, causing cycles.
-        if (src, dest).has_opaque_types() {
-            return true;
-        }
 
         crate::util::is_subtype(self.tcx, self.param_env, src, dest)
     }