Skip to content

Smarter integration of projection predicates into trait selection #20297

Closed
@nikomatsakis

Description

@nikomatsakis

The current logic that integrates projection predicates into trait selection is somewhat flawed. I made some simplifying choices:

  1. For one thing, it only works if the self type is a projection type, but in reality it should be able to handle any input type. Moreover, there may be multiple projection types in play.
  2. Also, the integration with inference is not particularly smart.
  3. Finally, if there are where clauses that overlap with projections, we currently just choose the where clause every time, but this may influence inference or have other subtle effects.

These all feel a bit like corner cases for now and I think we can get away with leaving things as they are and later coming in with a much smarter trait selection system. It's clear that we're pushing the bounds of the current setup. Trait reform 2.0 anybody?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions