mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
182b7c38d7
Also moves the lint to the methods directory
22 lines
771 B
Text
22 lines
771 B
Text
error: derefed type is same as origin
|
|
--> $DIR/needless_option_as_deref.rs:8:29
|
|
|
|
|
LL | let _: Option<&usize> = Some(&1).as_deref();
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try this: `Some(&1)`
|
|
|
|
|
= note: `-D clippy::needless-option-as-deref` implied by `-D warnings`
|
|
|
|
error: derefed type is same as origin
|
|
--> $DIR/needless_option_as_deref.rs:9:33
|
|
|
|
|
LL | let _: Option<&mut usize> = Some(&mut 1).as_deref_mut();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Some(&mut 1)`
|
|
|
|
error: derefed type is same as origin
|
|
--> $DIR/needless_option_as_deref.rs:13:13
|
|
|
|
|
LL | let _ = x.as_deref_mut();
|
|
| ^^^^^^^^^^^^^^^^ help: try this: `x`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|