From 182698fef275b187b4e0bf68d9ab38061ce55ff0 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 17 Apr 2024 10:09:38 +0000 Subject: [PATCH] Don't error on subtyping of equal types --- compiler/rustc_infer/src/infer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 1dbf435e8c738..255e688fbc1d9 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -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:?}"