Skip to content

Commit 56c135c

Browse files
committed
Revert "Rollup merge of rust-lang#123979 - oli-obk:define_opaque_types7, r=compiler-errors"
This reverts commit f939d1f, reversing changes made to 183c706.
1 parent 4649877 commit 56c135c

File tree

1 file changed

+2
-15
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+2
-15
lines changed

compiler/rustc_infer/src/infer/mod.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -957,27 +957,14 @@ impl<'tcx> InferCtxt<'tcx> {
957957
(&ty::Infer(ty::TyVar(a_vid)), &ty::Infer(ty::TyVar(b_vid))) => {
958958
return Err((a_vid, b_vid));
959959
}
960-
// We don't silently want to constrain hidden types here, so we assert that either one side is
961-
// an infer var, so it'll get constrained to whatever the other side is, or there are no opaque
962-
// types involved.
963-
// We don't expect this to actually get hit, but if it does, we now at least know how to write
964-
// a test for it.
965-
(_, ty::Infer(ty::TyVar(_))) => {}
966-
(ty::Infer(ty::TyVar(_)), _) => {}
967-
_ if r_a != r_b && (r_a, r_b).has_opaque_types() => {
968-
span_bug!(
969-
cause.span(),
970-
"opaque types got hidden types registered from within subtype predicate: {r_a:?} vs {r_b:?}"
971-
)
972-
}
973960
_ => {}
974961
}
975962

976963
self.enter_forall(predicate, |ty::SubtypePredicate { a_is_expected, a, b }| {
977964
if a_is_expected {
978-
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::Yes, a, b))
965+
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::No, a, b))
979966
} else {
980-
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::Yes, b, a))
967+
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::No, b, a))
981968
}
982969
})
983970
}

0 commit comments

Comments
 (0)