rust/tests
bors cb8df45333 Auto merge of #10027 - smoelius:fix-10021, r=dswij
Fix 10021

This PR proposes a fix for #10021.

The problem is similar to the one that `@mikerite` described in #9505. The compiler is generating an empty substitution for a call, even though the type of `Self` seems to be needed for a predicate. In `@mikerite's` case, the call was to [`IntoFuture::into_future`](https://doc.rust-lang.org/std/future/trait.IntoFuture.html#tymethod.into_future). In this case, the call is to [`Try::branch`](https://doc.rust-lang.org/std/ops/trait.Try.html#tymethod.branch).

The proposed fix is to verify that the parameter whose type is changing has an index within the substitution. The strikes me as a reasonable approach, since if the check were to fail, the following code would be a no-op:

4c123a06ba/clippy_lints/src/methods/unnecessary_to_owned.rs (L420-L428)

Like `@mikerite's` original solution, this solution turns ICEs into false negatives.

changelog: fix `unnecessary_to_owned` false positive involving `Try::branch`
2022-12-04 01:58:43 +00:00
..
test_utils Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
ui Auto merge of #10027 - smoelius:fix-10021, r=dswij 2022-12-04 01:58:43 +00:00
ui-cargo Merge commit 'f4850f7292' into clippyup 2022-11-21 20:51:52 +01:00
ui-internal Merge remote-tracking branch 'upstream/master' into rustup 2022-12-01 12:55:15 +01:00
ui-toml addressed review feedback 2022-11-27 10:34:13 -05:00
workspace_test
check-fmt.rs Merge commit 'f51aade56f' into clippyup 2022-08-31 09:24:45 -04:00
clippy.toml
compile-test.rs Merge commit '4f142aa105' into clippyup 2022-10-23 15:18:45 +02:00
dogfood.rs Merge commit '4f142aa105' into clippyup 2022-10-23 15:18:45 +02:00
integration.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
lint_message_convention.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
missing-test-files.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
versioncheck.rs Merge commit 'f4850f7292' into clippyup 2022-11-21 20:51:52 +01:00
workspace.rs Merge commit 'f51aade56f' into clippyup 2022-08-31 09:24:45 -04:00