diff options
| author | Quinn Sinclair <me@partiallytyped.dev> | 2023-12-26 20:34:00 +0200 |
|---|---|---|
| committer | PartiallyTyped <me@partiallytyped.dev> | 2023-12-26 21:25:06 +0200 |
| commit | 57dd25e2ffbf9c7abd63fcdf057facff7a46c342 (patch) | |
| tree | b4da19e31dd7e309c301a5fda7e6ebe6e506b46f /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 9dd2252b2c78013425816e6b288977bfafb1b659 (diff) | |
| download | rust-57dd25e2ffbf9c7abd63fcdf057facff7a46c342.tar.gz rust-57dd25e2ffbf9c7abd63fcdf057facff7a46c342.zip | |
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
