Skip to content

Blanket impl ProjectField for struct and union types #2902

Open

Description

@joshlf

...using STRUCT_VARIANT_ID and UNION_VARIANT_ID.

This applies once #2886 lands, which introduces that machinery. That PR provides a default impl of ProjectField:: is_projectable, and uses a PME to ensure that it's overridden for enum impls. It also implements ProjectField for all struct and union types manually in their respective derives.

We can instead provide a two blanket impls – one for structs and one for unions – and thus remove both the default impl of is_projectable and the impls emitted by derive code.

We'll want to look at the rustdoc output to see how this change affects it. In particular, we want it to be the case that, for a user-defined type, the rustdoc page for that type shows ProjectField impls for that type.

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