Skip to content

Commit f69ccb1

Browse files
authored
Rollup merge of #88691 - hyd-dev:88649, r=Mark-Simulacrum
Add a regression test for #88649 I noticed that #88649 does not have a regression test, so I add one in this PR. The test fails with this without #88678: ``` error[E0080]: evaluation of constant value failed --> /checkout/src/test/ui/consts/issue-88649.rs:13:52 | LL | Foo::Variant1(x) | Foo::Variant2(x) if x => {} | ^ StorageLive on a local that was already live error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. ```
2 parents 2bbcf92 + 214eef0 commit f69ccb1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/ui/consts/issue-88649.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// check-pass
2+
#![crate_type = "lib"]
3+
4+
enum Foo {
5+
Variant1(bool),
6+
Variant2(bool),
7+
}
8+
9+
const _: () = {
10+
let mut n = 0;
11+
while n < 2 {
12+
match Foo::Variant1(true) {
13+
Foo::Variant1(x) | Foo::Variant2(x) if x => {}
14+
_ => {}
15+
}
16+
n += 1;
17+
}
18+
};

0 commit comments

Comments
 (0)