Skip to content

Commit

Permalink
Add test for #[non_exhaustive] enum in `match_wildcard_for_single-v…
Browse files Browse the repository at this point in the history
…ariant`
  • Loading branch information
Jarcho committed Mar 8, 2021
1 parent 0523137 commit 456a541
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ui/match_wildcard_for_single_variants.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,16 @@ fn main() {
Some(_) => 1,
_ => 2,
};

#[non_exhaustive]
enum Bar {
A,
B,
C,
}
match Bar::A {
Bar::A => (),
Bar::B => (),
_ => (),
};
}
12 changes: 12 additions & 0 deletions tests/ui/match_wildcard_for_single_variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,16 @@ fn main() {
Some(_) => 1,
_ => 2,
};

#[non_exhaustive]
enum Bar {
A,
B,
C,
}
match Bar::A {
Bar::A => (),
Bar::B => (),
_ => (),
};
}

0 comments on commit 456a541

Please sign in to comment.