PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/box-inside-if.rs

http://github.com/jruderman/rust
Rust | 15 lines | 7 code | 7 blank | 1 comment | 2 complexity | 2c167c9c70fa587fe51060b0c2bd0367 MD5 | raw file
 1
 2
 3// -*- rust -*-
 4
 5fn some_box(x: int) -> @int { return @x; }
 6
 7fn is_odd(n: int) -> bool { return true; }
 8
 9fn length_is_even(vs: @int) -> bool { return true; }
10
11fn foo(acc: int, n: int) {
12    if is_odd(n) && length_is_even(some_box(1)) { error!{"bloop"}; }
13}
14
15fn main() { foo(67, 5); }