Skip to content
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

implement the ResolventOps methods for chalk integration #54935

Closed
nikomatsakis opened this issue Oct 9, 2018 · 1 comment · Fixed by #56214
Closed

implement the ResolventOps methods for chalk integration #54935

nikomatsakis opened this issue Oct 9, 2018 · 1 comment · Fixed by #56214
Assignees
Labels
A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804

Comments

@nikomatsakis
Copy link
Contributor

The methods in the ResolventOps trait are currently unimplemented:

impl context::ResolventOps<ChalkArenas<'gcx>, ChalkArenas<'tcx>>
for ChalkInferenceContext<'cx, 'gcx, 'tcx>
{
fn resolvent_clause(
&mut self,
_environment: &ty::ParamEnv<'tcx>,
_goal: &DomainGoal<'tcx>,
_subst: &CanonicalVarValues<'tcx>,
_clause: &ProgramClause<'tcx>,
) -> chalk_engine::fallible::Fallible<Canonical<'gcx, ChalkExClause<'gcx>>> {
panic!()
}
fn apply_answer_subst(
&mut self,
_ex_clause: ChalkExClause<'tcx>,
_selected_goal: &ty::ParamEnvAnd<'tcx, Goal<'tcx>>,
_answer_table_goal: &Canonical<'gcx, ty::ParamEnvAnd<'gcx, Goal<'gcx>>>,
_canonical_answer_subst: &Canonical<'gcx, ConstrainedSubst<'gcx>>,
) -> chalk_engine::fallible::Fallible<ChalkExClause<'tcx>> {
panic!()
}
}

These methods perform various unification-like operations and will need to be implemented in rustc.

@nikomatsakis nikomatsakis added A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804 labels Oct 9, 2018
@nikomatsakis
Copy link
Contributor Author

Another similar case is that the unify_parameters method must be implemented:

fn unify_parameters(
&mut self,
_environment: &ty::ParamEnv<'tcx>,
_a: &Kind<'tcx>,
_b: &Kind<'tcx>,
) -> ChalkEngineFallible<InferOk<'tcx, ()>> {
panic!()
}

@scalexm scalexm self-assigned this Nov 14, 2018
kennytm added a commit to kennytm/rust that referenced this issue Nov 30, 2018
Implement chalk unification routines

`ResolventOps` and `AggregateOps` are mostly straightforwardly translated from chalk. I had caught a few bugs already in my `chalk` branch and backported fixes to this branch, but there may be other ones left. EDIT: I hope there are none left now :)

Fixes rust-lang#54935.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants