Skip to content

[BUG] @derive(Eq) is confusing #316

@borup3

Description

@borup3

Describe the bug

@derive(Eq)
enum MyEnum {
    One,
    Two,
}

fn cmp_enum() -> bool {
    let one = MyEnum::One();
    let two = MyEnum::Two();
    return one == two;
}

I can't simply do one == two because it transpiles to eq(&one, two) instead of eq(&one, &two).

Is it intended that I have to do one == &two every time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions