rust/src/test/compile-fail/missing-return2.rs
Niko Matsakis 72a3667eb3 Allow tail expressions even in no_value blocks. Type checker
will guarantee they have unit type.
2012-01-03 13:13:52 -08:00

10 lines
211 B
Rust

// error-pattern: not all control paths return a value
fn f() -> int {
// Make sure typestate doesn't interpret this alt expression
// as the function result
alt true { true { } };
}
fn main() { }