• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![warn(clippy::unnecessary_lazy_evaluations)]
2 #![allow(clippy::unnecessary_literal_unwrap)]
3 
4 struct Deep(Option<usize>);
5 
6 #[derive(Copy, Clone)]
7 struct SomeStruct {
8     some_field: usize,
9 }
10 
main()11 fn main() {
12     // fix will break type inference
13     let _ = Ok(1).unwrap_or_else(|()| 2);
14     mod e {
15         pub struct E;
16     }
17     let _ = Ok(1).unwrap_or_else(|e::E| 2);
18     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
19 
20     // Fix #6343
21     let arr = [(Some(1),)];
22     Some(&0).and_then(|&i| arr[i].0);
23 }
24