chore: use multipart_suggestions for match_same_arms#13803
chore: use multipart_suggestions for match_same_arms#13803blyxyas merged 1 commit intorust-lang:masterfrom
Conversation
9ac0f8c to
7d1e0da
Compare
blyxyas
left a comment
There was a problem hiding this comment.
LGTM, thanks! ❤️
I'm wondering if we could also remove the @no-rustfix from match_same_arms.rs, now that rust-lang/cargo#14747 is merged. Could you test that? (Different issue, but I figure that it's related enough.)
|
Hey @blyxyas thanks for taking a look! rust-clippy/tests/ui/match_same_arms.rs Lines 31 to 38 in 6a3ef93 We generate two suggestions - one to combine 1 and 2, and one to combine 2 and 3. These overlap and the second application fails. It looks like the issue is that we're pairwise matching arms up, rather than collecting all arms that have the same body and suggesting an aggregate fix: rust-clippy/clippy_lints/src/matches/match_same_arms.rs Lines 115 to 116 in 6a3ef93 I'm happy to fix this but feel like it's probably "removed enough" from the multipart_suggestion to throw another issue in and fix it in a separate PR. What do you think? |
|
I agree with you, fixing that would count as another issue, and opening another PR instead of making this one bigger would help with atomic PRs. |
This addresses #13099 for the match_same_arms lint.
changelog: [match_same_arms]: Updated match_same_arms to use multipart_suggestions where appropriate