mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 21:04:18 +00:00
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.
This commit is contained in:
parent
1ff80eefe1
commit
fd77af3a78
1 changed files with 16 additions and 6 deletions
|
|
@ -808,14 +808,24 @@ impl<'db> ChalkToNextSolver<'db, PredicateKind<'db>> for chalk_ir::DomainGoal<In
|
||||||
_ => unimplemented!(),
|
_ => unimplemented!(),
|
||||||
};
|
};
|
||||||
let args: GenericArgs<'db> = proj_ty.substitution.to_nextsolver(interner);
|
let args: GenericArgs<'db> = proj_ty.substitution.to_nextsolver(interner);
|
||||||
let alias = rustc_type_ir::AliasTerm::new(
|
let alias = Ty::new(
|
||||||
interner,
|
interner,
|
||||||
from_assoc_type_id(proj_ty.associated_ty_id).into(),
|
rustc_type_ir::TyKind::Alias(
|
||||||
args,
|
rustc_type_ir::AliasTyKind::Projection,
|
||||||
);
|
rustc_type_ir::AliasTy::new(
|
||||||
|
interner,
|
||||||
|
from_assoc_type_id(proj_ty.associated_ty_id).into(),
|
||||||
|
args,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.into();
|
||||||
let term = normalize.ty.to_nextsolver(interner).into();
|
let term = normalize.ty.to_nextsolver(interner).into();
|
||||||
let normalizes_to = rustc_type_ir::NormalizesTo { alias, term };
|
PredicateKind::AliasRelate(
|
||||||
PredicateKind::NormalizesTo(normalizes_to)
|
alias,
|
||||||
|
term,
|
||||||
|
rustc_type_ir::AliasRelationDirection::Equate,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
chalk_ir::DomainGoal::WellFormed(well_formed) => {
|
chalk_ir::DomainGoal::WellFormed(well_formed) => {
|
||||||
let term = match well_formed {
|
let term = match well_formed {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue