rust/tests
Jason Newcomb f144c6cc66
feat(search_is_some): Fix when the closure spans multiple lines (#15902)
Previously the program only fixed the code when the closure supplied to
the method contained only 1 line. This patch removes the restriction.

The code already works. This patch only removes the extra check that
causes the restriction. The test cases that can now be fixed are moved
into the files containing tests cases that can be fixed.

The unnecessary check has survived in the code this way.

- In Dec 2015, patch a6bd2d0622, pull request
rust-lang/rust-clippy#524. The lint was first added. The program did not
support fixing code automatically yet. So the suggested fix was printed
as a part of the diagnostic message. When the original code contained
multiple lines, the suggested fix was omitted in order to keep the
diagnostic message concise.

- In May 2019, patch bd0b75f6c3, pull request
rust-lang/rust-clippy#4049. Logic was added to strip the reference in
the closure when the suggested replacement method required it. Because
the fix was still only printed when the code contained a single line,
the new transformation was only done when the code contained a single
line.

- In Aug 2019, patch 945d4cf69f, pull request
rust-lang/rust-clippy#4454. The lint was updated to fix code
automatically. Because the fixed code had only been printed in the
diagnostic message for a single line, the fix was only added for a
single line.

- In Nov 2021, patch 092fe209a6, pull request
rust-lang/rust-clippy#7463. The logic for transforming the closure was
moved into another file. A comment was added saying that it was only
good for a single line because it had only been used for a single line.

changelog: [`search_is_some`] now fixes code spanning multiple lines
2025-10-28 09:39:01 +00:00
..
test_utils
ui feat(search_is_some): Fix when the closure spans multiple lines (#15902) 2025-10-28 09:39:01 +00:00
ui-cargo unnecessary_safety_comment fix an ICE and 2025-10-14 22:23:53 +01:00
ui-internal Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
ui-toml chore(needless_if): rename to needless_ifs 2025-10-27 11:00:57 +01: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 Use expect for lint warnings 2025-10-06 20:17:12 -04:00
config-consistency.rs Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
config-metadata.rs
dogfood.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02: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 Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
no-profile-in-cargo-toml.rs Merge commit '20ce69b9a6' into clippy-subtree-update 2025-09-18 17:21:44 +02:00
symbols-used.rs Use expect for lint warnings 2025-10-06 20:17:12 -04:00
versioncheck.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
workspace.rs