Skip to content

Traits with where clauses that themselves reference associated types #18436

Description

@nikomatsakis

Based on a read of the implementation, I believe situations like this are incorrectly handled:

trait Foo {
    type Out;
}

trait Bar<T: Foo> {
}

The problem is that Bar needs a synthetic parameter to play the role of T::Out, but the current code only adds synthetic parameters to things other than traits (since, in a trait, we add the parameters for the associated types defined within the trait itself). We also do not add synthetic parameters for bounds appearing on structs etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions