]> git.lizzy.rs Git - rust.git/blob - src/test/ui/if-check.rs
Auto merge of #75406 - mati865:mingw-aslr, r=Mark-Simulacrum
[rust.git] / src / test / ui / if-check.rs
1 // run-pass
2
3 fn even(x: usize) -> bool {
4     if x < 2 {
5         return false;
6     } else if x == 2 { return true; } else { return even(x - 2); }
7 }
8
9 fn foo(x: usize) {
10     if even(x) {
11         println!("{}", x);
12     } else {
13         panic!();
14     }
15 }
16
17 pub fn main() { foo(2); }