Skip to content

Commit 5cbed75

Browse files
Test
1 parent a407d60 commit 5cbed75

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/ui/liveness/liveness-dead.rs

+18
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,22 @@ fn f6() {
3636
}
3737
}
3838

39+
fn f7(x: i32) {
40+
match x {
41+
n if n > 22 => {} // no error
42+
_ => {}
43+
}
44+
}
45+
46+
fn f8(x: Option<i32>) -> i32 {
47+
match x {
48+
None => 0,
49+
Some(mut n) => {
50+
//~^ ERROR: value assigned to `n` is never read
51+
n = 42;
52+
n
53+
}
54+
}
55+
}
56+
3957
fn main() {}

0 commit comments

Comments
 (0)