Rollup merge of #124066 - oli-obk:define_opaque_types7, r=compiler-errors

Don't error on subtyping of equal types

fixes https://github.com/rust-lang/rust/issues/124054 🤦
fixes #124075
fixes https://github.com/rust-lang/rust/issues/124079

r? `@compiler-errors`
This commit is contained in:
Matthias Krüger 2024-04-17 18:01:40 +02:00 committed by GitHub
commit 116c0f7288
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -952,7 +952,7 @@ impl<'tcx> InferCtxt<'tcx> {
// a test for it.
(_, ty::Infer(ty::TyVar(_))) => {}
(ty::Infer(ty::TyVar(_)), _) => {}
_ if (r_a, r_b).has_opaque_types() => {
_ 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:?}"