about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper
diff options
context:
space:
mode:
authorQuinn Sinclair <me@partiallytyped.dev>2023-12-26 20:34:00 +0200
committerPartiallyTyped <me@partiallytyped.dev>2023-12-26 21:25:06 +0200
commit57dd25e2ffbf9c7abd63fcdf057facff7a46c342 (patch)
treeb4da19e31dd7e309c301a5fda7e6ebe6e506b46f /compiler/rustc_llvm/llvm-wrapper
parent9dd2252b2c78013425816e6b288977bfafb1b659 (diff)
downloadrust-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')
0 files changed, 0 insertions, 0 deletions