rust/clippy_lints
bors e7a3cb7ab0 Auto merge of #12021 - PartiallyTyped:11982, r=flip1995
FP: `needless_return_with_question_mark` with implicit Error Conversion

Return with a question mark was triggered in situations where the `?` desuraging was performing error conversion via `Into`/`From`.

The desugared `?` produces a match over an expression with type `std::ops::ControlFlow<B,C>` with `B:Result<Infallible, E:Error>` and `C:Result<_, E':Error>`, and the arms perform the conversion. The patch adds another check in the lint that checks that `E == E'`. If `E == E'`, then the `?` is indeed unnecessary.

changelog: False Positive: [`needless_return_with_question_mark`] when implicit Error Conversion occurs.

fixes: #11982
2024-01-29 09:10:02 +00:00
..
src Auto merge of #12021 - PartiallyTyped:11982, r=flip1995 2024-01-29 09:10:02 +00:00
Cargo.toml Updating dependencies 2024-01-21 09:29:05 -06:00
README.md

This crate contains Clippy lints. For the main crate, check GitHub.