rust/tests/compile-fail/methods.rs
Georg Brandl 2bcc151888 new lint for Option.unwrap() and Result.unwrap()
The latter is set to Allow by default (fixes #24)
2015-08-11 21:19:11 +02:00

12 lines
236 B
Rust
Executable File

#![feature(plugin)]
#![plugin(clippy)]
#[deny(option_unwrap_used, result_unwrap_used)]
fn main() {
let opt = Some(0);
let _ = opt.unwrap(); //~ERROR
let res: Result<i32, ()> = Ok(0);
let _ = res.unwrap(); //~ERROR
}