rust/src/test/compile-fail/liveness-forgot-ret.rs

9 lines
201 B
Rust

// -*- rust -*-
// error-pattern: not all control paths return a value
fn god_exists(a: int) -> bool { ret god_exists(a); }
fn f(a: int) -> int { if god_exists(a) { ret 5; }; }
fn main() { f(12); }