Skip to content

Commit f246fe4

Browse files
Merge the sub and incompleteness
1 parent 5d234bc commit f246fe4

File tree

2 files changed

+13
-2
lines changed
  • compiler/rustc_next_trait_solver/src/solve

2 files changed

+13
-2
lines changed

compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_type_ir::{
1414
use tracing::instrument;
1515

1616
use super::trait_goals::TraitGoalProvenVia;
17-
use super::{has_only_region_constraints, has_only_region_constraints, inspect, inspect};
17+
use super::{has_only_region_constraints, inspect, inspect};
1818
use crate::delegate::SolverDelegate;
1919
use crate::solve::inspect::ProbeKind;
2020
use crate::solve::{

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,18 @@ where
11151115
self.delegate
11161116
.clone_opaque_types_for_query_response()
11171117
.into_iter()
1118-
.find(|(_, hidden_ty)| *hidden_ty == self_ty)
1118+
.find(|(_, hidden_ty)| {
1119+
if let ty::Infer(ty::TyVar(self_vid)) = self_ty.kind() {
1120+
if let ty::Infer(ty::TyVar(hidden_vid)) = hidden_ty.kind() {
1121+
if self.delegate.sub_root_ty_var(self_vid)
1122+
== self.delegate.sub_root_ty_var(hidden_vid)
1123+
{
1124+
return true;
1125+
}
1126+
}
1127+
}
1128+
false
1129+
})
11191130
.map(|(key, _)| ty::AliasTy::new_from_args(self.cx(), key.def_id.into(), key.args))
11201131
}
11211132
}

0 commit comments

Comments
 (0)