Skip to content

Allow tuples to be compared with == operator #748

Open
@cburgdorf

Description

@cburgdorf

What is wrong?

We currently can't easily compare tuples with the == operator. E.g. the following doesn't work.

if get_tuple() == (1, 2) {
...
}

Instead what we have to do is:

if get_tuple() == (1, 2) {
...
}
let (val1, val2): (u8, u8) = get_tuple()
if val1 == 1 and val2 == 2 {
}

How can it be fixed

We can probably tackle that at MIR lowering

Make PartialEq and Eq traits possible and use them for this.

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