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

9 lines
200 B
Rust
Raw Normal View History

// -*- rust -*-
// error-pattern: not all control paths return a value
2011-07-27 14:19:39 +02:00
fn god_exists(a: int) -> bool { be god_exists(a); }
fn f(a: int) -> int { if god_exists(a) { ret 5; }; }
fn main() { f(12); }