Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also check or-ed values in a single match arm? #15

Open
hoijui opened this issue Oct 15, 2021 · 0 comments
Open

Also check or-ed values in a single match arm? #15

hoijui opened this issue Oct 15, 2021 · 0 comments

Comments

@hoijui
Copy link

hoijui commented Oct 15, 2021

In the match, the 4 variants are not ordered (B, E, C, D):

extern crate remain;

#[remain::sorted]
#[derive(Clone, Copy)]
enum My {
    A,
    B,
    C,
    D,
    E,
}

#[remain::check]
fn f(a: My) {
    #[remain::sorted]
    match a {
        My::A => (),
        My::B | My::E | My::C | My::D => (),
    }
}

fn main() {
    f(My::E);
}

PlayGround link

... and thanks for all your cool rust stuff! I am also going through the quiz... wow! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant