rustc/tests/ui/liveness/liveness-forgot-ret.rs
2024-06-21 09:39:33 +02:00

8 lines
220 B
Rust

fn god_exists(a: isize) -> bool { return god_exists(a); }
//~^ WARN function cannot return without recursing
fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
//~^ ERROR mismatched types
fn main() { f(12); }