Skip to content

Commit 687659f

Browse files
committed
Add diverging match guard test.
1 parent 2dbbec3 commit 687659f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tests/ui/binding/issue-53114-borrow-checks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn let_wild_gets_moved_expr() {
2020
fn match_moved_expr_to_wild() {
2121
let m = M;
2222
drop(m);
23-
match m { _ => { } } // #53114: should eventually be accepted too
23+
match m { _ => { } } // #53114: accepted too
2424

2525
let mm = (M, M); // variation on above with `_` in substructure
2626
match mm { (_x, _) => { } }
@@ -31,7 +31,7 @@ fn match_moved_expr_to_wild() {
3131
fn if_let_moved_expr_to_wild() {
3232
let m = M;
3333
drop(m);
34-
if let _ = m { } // #53114: should eventually be accepted too
34+
if let _ = m { } // #53114: accepted too
3535

3636
let mm = (M, M); // variation on above with `_` in substructure
3737
if let (_x, _) = mm { }
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// check-pass
2+
3+
enum Void {}
4+
5+
fn main() {
6+
let x: Void;
7+
match x {
8+
_ if { loop {} } => (),
9+
}
10+
}

0 commit comments

Comments
 (0)