PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/src/test/compile-fail/bad-bang-ann.rs

http://github.com/jruderman/rust
Rust | 9 lines | 4 code | 2 blank | 3 comment | 2 complexity | d1c0c80b0ae85e08cc7ae57b5f22022c MD5 | raw file
1// -*- rust -*-
2// Tests that a function with a ! annotation always actually fails
3
4fn bad_bang(i: uint) -> ! {
5    if i < 0u { } else { fail; }
6    //~^ ERROR expected `_|_` but found `()`
7}
8
9fn main() { bad_bang(5u); }