rust/tests
Timo 936baca0cd
Consider deref'ed argument as non-temporary (#15172)
If there are more than one dereference (there is one corresponding
matched with a borrow in any case), consider that the argument might
point to a place expression, which is the safest choice.

Also, use an appropriate number of dereferences in suggestions involving
arguments using themselves multiple dereferences.

Fixes rust-lang/rust-clippy#15166

changelog: [`swap_with_temporary`]: fix false positive leading to
different semantics being suggested, and use the right number of
dereferences in suggestion

r? y21

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[beta-nomination](https://github.com/rust-lang/rust-clippy/pull/15172#issuecomment-3016752569)
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 -->
2025-06-30 18:46:11 +00:00
..
test_utils
ui Consider deref'ed argument as non-temporary (#15172) 2025-06-30 18:46:11 +00:00
ui-cargo Merge commit '9f9a822509' into clippy-subtree-update 2025-02-28 23:27:09 +01:00
ui-internal Merge commit '0450db33a5' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
ui-toml Fix collapsible_else_if FP on conditionally compiled stmt (#14906) 2025-06-13 15:45:00 +00:00
workspace_test
check-fmt.rs
clippy.toml Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
compile-test.rs Prepare to split lints into multiple crates 2025-06-18 22:37:23 -04:00
config-metadata.rs
dogfood.rs Prepare to split lints into multiple crates 2025-06-18 22:37:23 -04:00
integration.rs Merge commit '0450db33a5' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
lint_message_convention.rs Merge commit '1e5237f4a5' into clippy-subtree-update 2025-03-20 22:34:29 +01:00
missing-test-files.rs Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
symbols-used.rs Merge commit '4ef75291b5' into clippy-subtree-update 2025-06-13 11:24:45 +02:00
versioncheck.rs Prepare to split lints into multiple crates 2025-06-18 22:37:23 -04:00
workspace.rs