Skip to content

permit context to control subgoal selection order #80

Open
@nikomatsakis

Description

@nikomatsakis

The on-demand solver, when faced with an X-clause, currently always selects the "last" literal in the list. This is pretty silly. It would be smarter to look for literals that are closer to being solved, and maybe make some heuristics that look at the traits involved.

I think it might be useful to have a rough idea of the "inputs" and "outputs" from given domain goals (many prologs have modal annotations of this kind, I've not looked deeply at how they work). So for example given this set of pending goals:

NormalizeTo(<T as Bar>::Item -> ?U)
?U: Foo

It would be better to start with the normalization, since otherwise we would wind up enumerating all type variables that implement Foo.

In fact, targeting this scenario is the primary rule we need, I think, given Rust's limitations around constrained type parameters on impls. (Rustc has some similar logic already, actually.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-chalk-engineIssues related to the chalk-engine cratedesignNeeds design work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions