-
Notifications
You must be signed in to change notification settings - Fork 1.8k
internal: Migrate inference to next solver #20765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,10 @@ use crate::{ | |
error_lifetime, | ||
generics::generics, | ||
infer::unify::InferenceTable, | ||
next_solver::{DbInterner, EarlyBinder, mapping::ChalkToNextSolver}, | ||
next_solver::{ | ||
DbInterner, EarlyBinder, | ||
mapping::{ChalkToNextSolver, NextSolverToChalk}, | ||
}, | ||
primitive, to_assoc_type_id, to_chalk_trait_id, | ||
}; | ||
|
||
|
@@ -141,10 +144,13 @@ impl<D> TyBuilder<D> { | |
|
||
#[tracing::instrument(skip_all)] | ||
pub(crate) fn fill_with_inference_vars(self, table: &mut InferenceTable<'_>) -> Self { | ||
self.fill(|x| match x { | ||
ParamKind::Type => table.new_type_var().cast(Interner), | ||
ParamKind::Const(ty) => table.new_const_var(ty.clone()).cast(Interner), | ||
ParamKind::Lifetime => table.new_lifetime_var().cast(Interner), | ||
self.fill(|x| { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a bunch of code that I migrated from |
||
match x { | ||
ParamKind::Type => crate::next_solver::GenericArg::Ty(table.next_ty_var()), | ||
ParamKind::Const(_) => table.next_const_var().into(), | ||
ParamKind::Lifetime => table.next_region_var().into(), | ||
} | ||
.to_chalk(table.interner()) | ||
}) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of unrelated change, put it because I was clarified (#t-types > Do I need to prove T: Trait for <T as Trait>::Assoc = Foo?) that we do need to prove the obligation
T: Deref
first, before normalizing.