about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-29 09:10:02 +0000
committerbors <bors@rust-lang.org>2024-01-29 09:10:02 +0000
commite7a3cb7ab09a946e435fe067e2da50c9ddaeeb56 (patch)
tree014bd6c3c0abf3441b4de586ef6e1d8dbb427a94 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent8ccf6a61eea595db738c8e764531848ae7bad0c3 (diff)
parent3aa2c279c8d1a64c8ecbf4c4e9f1b5bc8f9c4883 (diff)
downloadrust-e7a3cb7ab09a946e435fe067e2da50c9ddaeeb56.tar.gz
rust-e7a3cb7ab09a946e435fe067e2da50c9ddaeeb56.zip
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions