Skip to content

[repr(C)] enum only accepts int constants #15270

Closed
@mahkoh

Description

@mahkoh
static X: i32 = 1;
static Y: i32 = 2;

#[repr(C)]
enum Foo {
    Bar = X,
    Baz = Y,
}

This worked in 1e6b699 but not in a490871.

cc @huonw

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions