Skip to content

The non_exhaustive_omitted_patterns lint changed #1522

Description

@Nadrieril

Hi! In rust-lang/rust#116734 I changed how the lint works to make it more consistent. A consequence is that it no longer makes sense to set the lint level on a specific arm like was recommended before:

match Bar::A {
    Bar::A => {},
    #[warn(non_exhaustive_omitted_patterns)]
    _ => {},
}

It is now recommended to set it on the whole match, or even globally.

#[warn(non_exhaustive_omitted_patterns)]
match Bar::A {
    Bar::A => {},
    _ => {},
}

I didn't realize there was heavy usage of this lint when I made the change, but I understand syn recommends it to avoid breakage? Once rust-lang/rust#117094 lands, setting the lint level on a single arm will raise an error, so the users can update. I thought I'd warn you before, also lmk if I should wait or do it differently. If it's really bad I can emulate the old behavior for a while.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions