Skip to content

Commit 4b5bb18

Browse files
Don't map Chalk's Normalize to next solver's NormalizesTo
`NormalizesTo` is a private predicate that should not be used outside the solver. For normalization, rustc uses `AliasRelate`, so replace with that.
1 parent aa49c0b commit 4b5bb18

File tree

1 file changed

+16
-6
lines changed
  • src/tools/rust-analyzer/crates/hir-ty/src/next_solver

1 file changed

+16
-6
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/mapping.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,24 @@ impl<'db> ChalkToNextSolver<'db, PredicateKind<'db>> for chalk_ir::DomainGoal<In
808808
_ => unimplemented!(),
809809
};
810810
let args: GenericArgs<'db> = proj_ty.substitution.to_nextsolver(interner);
811-
let alias = rustc_type_ir::AliasTerm::new(
811+
let alias = Ty::new(
812812
interner,
813-
from_assoc_type_id(proj_ty.associated_ty_id).into(),
814-
args,
815-
);
813+
rustc_type_ir::TyKind::Alias(
814+
rustc_type_ir::AliasTyKind::Projection,
815+
rustc_type_ir::AliasTy::new(
816+
interner,
817+
from_assoc_type_id(proj_ty.associated_ty_id).into(),
818+
args,
819+
),
820+
),
821+
)
822+
.into();
816823
let term = normalize.ty.to_nextsolver(interner).into();
817-
let normalizes_to = rustc_type_ir::NormalizesTo { alias, term };
818-
PredicateKind::NormalizesTo(normalizes_to)
824+
PredicateKind::AliasRelate(
825+
alias,
826+
term,
827+
rustc_type_ir::AliasRelationDirection::Equate,
828+
)
819829
}
820830
chalk_ir::DomainGoal::WellFormed(well_formed) => {
821831
let term = match well_formed {

0 commit comments

Comments
 (0)