Skip to content

Commit

Permalink
Add a regression test for rust-lang#88649
Browse files Browse the repository at this point in the history
(cherry picked from commit 214eef0)
  • Loading branch information
hyd-dev authored and cuviper committed Sep 16, 2021
1 parent 726ab14 commit 244a097
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/ui/consts/issue-88649.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// check-pass
#![crate_type = "lib"]

enum Foo {
Variant1(bool),
Variant2(bool),
}

const _: () = {
let mut n = 0;
while n < 2 {
match Foo::Variant1(true) {
Foo::Variant1(x) | Foo::Variant2(x) if x => {}
_ => {}
}
n += 1;
}
};

0 comments on commit 244a097

Please sign in to comment.