rust-clippy/tests/ui/needless_option_as_deref.stderr
2023-08-11 14:02:28 +00:00

22 lines
756 B
Text

error: derefed type is same as origin
--> $DIR/needless_option_as_deref.rs:7:29
|
LL | let _: Option<&usize> = Some(&1).as_deref();
| ^^^^^^^^^^^^^^^^^^^ help: try: `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:8:33
|
LL | let _: Option<&mut usize> = Some(&mut 1).as_deref_mut();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(&mut 1)`
error: derefed type is same as origin
--> $DIR/needless_option_as_deref.rs:12:13
|
LL | let _ = x.as_deref_mut();
| ^^^^^^^^^^^^^^^^ help: try: `x`
error: aborting due to 3 previous errors