Skip to content

impl_stable_hash_for! does not support enums with named fields #54075

Description

@RalfJung

In miri, we are now carrying some hand-written implementations of HashStable because the macro impl_stable_hash_for! does not support enum variants with named fields, e.g.

pub enum StackPopCleanup {
    Goto(Option<mir::BasicBlock>),
    None { cleanup: bool },
}

This is rather annoying and also error-prone, e.g. the manual implementations forgot to hash the discriminant.

impl_stable_hash_for! should support enums like the above.

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

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions