Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Derive macros fail with new "explicit discriminants on enums with fields" #606

@timwie

Description

@timwie

Rust 1.66 was just released, along with Explicit discriminants on enums with fields. The given example does not compile when adding bincode (2.0.0-rc.2) derive macros to the enum:

$ cargo -V
# cargo 1.66.0 (d65d197ad 2022-11-15)
#[derive(Decode, Encode)]
#[repr(u8)]
enum Foo {
    A(u8),
    B(i8),
    C(bool) = 42,
}

# error: Invalid rust syntax, expected ident, got Some(Punct { ch: '=', spacing: Alone, span: #0 bytes(334..335) })

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