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

9 lines
201 B
Rust
Raw Normal View History

// -*- rust -*-
// error-pattern: not all control paths return a value
2012-05-14 16:55:01 -07:00
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); }