]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_lazy_eval_unfixable.rs
Auto merge of #6421 - xFrednet:4176-unreadable-literal-lint-fractal-option, r=Manishearth
[rust.git] / tests / ui / unnecessary_lazy_eval_unfixable.rs
1 #![warn(clippy::unnecessary_lazy_evaluations)]
2
3 struct Deep(Option<usize>);
4
5 #[derive(Copy, Clone)]
6 struct SomeStruct {
7     some_field: usize,
8 }
9
10 fn main() {
11     // fix will break type inference
12     let _ = Ok(1).unwrap_or_else(|()| 2);
13     mod e {
14         pub struct E;
15     }
16     let _ = Ok(1).unwrap_or_else(|e::E| 2);
17     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
18 }