about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorllogiq <bogusandre@gmail.com>2025-07-06 15:24:46 +0000
committerGitHub <noreply@github.com>2025-07-06 15:24:46 +0000
commitcc7b2f57e0b6b134c1881f17c6db83635ad5fe67 (patch)
tree63a02c2fc4d206bc5c12b379aea73163dbf6d38b /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent5c51a1d9d3b3f6fd5320e8b05dabd82261898608 (diff)
parent89f7a4301d8a547ee819dfefd95ac7d40005b8cc (diff)
downloadrust-cc7b2f57e0b6b134c1881f17c6db83635ad5fe67.tar.gz
rust-cc7b2f57e0b6b134c1881f17c6db83635ad5fe67.zip
Properly check that an expression might be the one returned (#15115)
The `TyCtxt::hir_get_fn_id_for_return_block()` function was too broad,
as it will return positively even when given part of an expression that
can be used as a return value. A new
`potential_return_of_enclosing_body()` utility function has been made to
represent the fact that an expression might be directly returned from
its enclosing body.

changelog: [`return_and_then`]: prevent false positives in case of a
partially used expression

Fixes rust-lang/rust-clippy#15111
Fixes rust-lang/rust-clippy#14927

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[Beta-nomination](https://github.com/rust-lang/rust-clippy/pull/15115#issuecomment-2996222332)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions