Skip to content

Commit d873c61

Browse files
committed
add no lint tests for match if and if match
1 parent e7c528d commit d873c61

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/ui/stacked_if_match.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,31 @@ fn match_no_lint() {
7777
}
7878
}
7979

80+
fn if_match_no_lint() {
81+
let x = 0;
82+
if match x {
83+
1 => 2,
84+
_ => 3,
85+
} == 4 {
86+
println!("true");
87+
}
88+
}
89+
90+
fn match_if_no_lint() {
91+
let x = 0;
92+
match if x == 1 {
93+
let y = 2;
94+
y + 1
95+
} else {
96+
let z = 3;
97+
z + 1
98+
} {
99+
1 => {},
100+
2 => {},
101+
_ => {},
102+
}
103+
}
104+
80105
macro_rules! if_macro {
81106
($var:ident) => {
82107
if $var == 1 { true } else { false }

0 commit comments

Comments
 (0)