Skip to content

Commit c1d722c

Browse files
authored
Rollup merge of rust-lang#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
2 parents d667105 + 0accf08 commit c1d722c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_const_eval/src/transform/validate.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::mir::{
1313
ProjectionElem, RetagKind, RuntimePhase, Rvalue, SourceScope, Statement, StatementKind,
1414
Terminator, TerminatorKind, UnOp, START_BLOCK,
1515
};
16-
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeVisitable};
16+
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt};
1717
use rustc_mir_dataflow::impls::MaybeStorageLive;
1818
use rustc_mir_dataflow::storage::always_storage_live_locals;
1919
use rustc_mir_dataflow::{Analysis, ResultsCursor};
@@ -230,11 +230,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
230230
// Equal types, all is good.
231231
return true;
232232
}
233-
// Normalization reveals opaque types, but we may be validating MIR while computing
234-
// said opaque types, causing cycles.
235-
if (src, dest).has_opaque_types() {
236-
return true;
237-
}
238233

239234
crate::util::is_subtype(self.tcx, self.param_env, src, dest)
240235
}

0 commit comments

Comments
 (0)