]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/methods.rs
Merge pull request #145 from birkenfeld/string_to_string
[rust.git] / tests / compile-fail / methods.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #[deny(option_unwrap_used, result_unwrap_used)]
5 #[deny(str_to_string, string_to_string)]
6 fn main() {
7     let opt = Some(0);
8     let _ = opt.unwrap();  //~ERROR
9
10     let res: Result<i32, ()> = Ok(0);
11     let _ = res.unwrap();  //~ERROR
12
13     let string = "str".to_string();  //~ERROR
14     let _again = string.to_string();  //~ERROR
15 }