diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-05-24 13:21:59 +0000 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2024-06-06 11:41:35 -0700 |
| commit | 97e94c19921c6940d5da602384276ee1270268a2 (patch) | |
| tree | 8d78865e68e7a86a7e63cc457f10e622fedc0f8c | |
| parent | b8fb165d41a9bd78d80fc9a2f5fff2ec8bb4ebf3 (diff) | |
| download | rust-97e94c19921c6940d5da602384276ee1270268a2.tar.gz rust-97e94c19921c6940d5da602384276ee1270268a2.zip | |
Revert "Rollup merge of #123979 - oli-obk:define_opaque_types7, r=compiler-errors"
This reverts commit f939d1ff4820844595d0f50f94038869f1445d08, reversing changes made to 183c706305d8c4e0ccb0967932381baf7e0c3611. (cherry picked from commit 56c135c9253563f92755b0a9cd54ec67f7c17fc7)
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 81130d69151..0fcd043dc85 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -945,27 +945,14 @@ impl<'tcx> InferCtxt<'tcx> { (&ty::Infer(ty::TyVar(a_vid)), &ty::Infer(ty::TyVar(b_vid))) => { return Err((a_vid, b_vid)); } - // We don't silently want to constrain hidden types here, so we assert that either one side is - // an infer var, so it'll get constrained to whatever the other side is, or there are no opaque - // types involved. - // We don't expect this to actually get hit, but if it does, we now at least know how to write - // a test for it. - (_, ty::Infer(ty::TyVar(_))) => {} - (ty::Infer(ty::TyVar(_)), _) => {} - _ if r_a != r_b && (r_a, r_b).has_opaque_types() => { - span_bug!( - cause.span(), - "opaque types got hidden types registered from within subtype predicate: {r_a:?} vs {r_b:?}" - ) - } _ => {} } self.enter_forall(predicate, |ty::SubtypePredicate { a_is_expected, a, b }| { if a_is_expected { - Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::Yes, a, b)) + Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::No, a, b)) } else { - Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::Yes, b, a)) + Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::No, b, a)) } }) } |
