mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-18 10:48:36 +00:00
c0d1002d93
Fixes #6240
18 lines
380 B
Rust
18 lines
380 B
Rust
#![warn(clippy::unnecessary_lazy_evaluations)]
|
|
|
|
struct Deep(Option<usize>);
|
|
|
|
#[derive(Copy, Clone)]
|
|
struct SomeStruct {
|
|
some_field: usize,
|
|
}
|
|
|
|
fn main() {
|
|
// fix will break type inference
|
|
let _ = Ok(1).unwrap_or_else(|()| 2);
|
|
mod e {
|
|
pub struct E;
|
|
}
|
|
let _ = Ok(1).unwrap_or_else(|e::E| 2);
|
|
let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
|
|
}
|