Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[map_identity]: recognize tuple identity function #10943

Merged
merged 1 commit into from Oct 21, 2023
Merged

Conversation

y21
Copy link
Member

@y21 y21 commented Jun 13, 2023

Fixes #7189

This lint now recognizes .map(|(a, b)| (a, b)) as a useless map call.

changelog: [map_identity]: recognize tuple identity function

@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2023

r? @llogiq

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 13, 2023
@llogiq
Copy link
Contributor

llogiq commented Oct 17, 2023

Now it should not lint on type-ascribing identities, otherwise looks good.

@y21
Copy link
Member Author

y21 commented Oct 17, 2023

Now it should not lint on type-ascribing identities, otherwise looks good.

My other PR #11521 should do this, right? Would it make sense to get that in first?

@llogiq
Copy link
Contributor

llogiq commented Oct 20, 2023

With #11521 merged, this should be merge-worthy.

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 20, 2023

📌 Commit a78c53a has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 20, 2023

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout issue7189 (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self issue7189 --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging tests/ui/map_identity.stderr
Auto-merging tests/ui/map_identity.rs
CONFLICT (content): Merge conflict in tests/ui/map_identity.rs
Auto-merging tests/ui/map_identity.fixed
CONFLICT (content): Merge conflict in tests/ui/map_identity.fixed
Auto-merging lintcheck/src/main.rs
Auto-merging clippy_utils/src/lib.rs
CONFLICT (content): Merge conflict in clippy_utils/src/lib.rs
Automatic merge failed; fix conflicts and then commit the result.

@y21
Copy link
Member Author

y21 commented Oct 20, 2023

Yeah, I knew these conflicts were gonna happen :D will fix them in a couple hours.

@bors
Copy link
Collaborator

bors commented Oct 20, 2023

☔ The latest upstream changes (presumably #11521) made this pull request unmergeable. Please resolve the merge conflicts.

@y21 y21 force-pushed the issue7189 branch 2 times, most recently from 875de5b to 41bf5d2 Compare October 20, 2023 19:07
@bors
Copy link
Collaborator

bors commented Oct 21, 2023

☔ The latest upstream changes (presumably #11694) made this pull request unmergeable. Please resolve the merge conflicts.

@llogiq
Copy link
Contributor

llogiq commented Oct 21, 2023

@bors delegate+

@bors
Copy link
Collaborator

bors commented Oct 21, 2023

✌️ @y21, you can now approve this pull request!

If @llogiq told you to "r=me" after making some further change, please make that change, then do @bors r=@llogiq

@y21
Copy link
Member Author

y21 commented Oct 21, 2023

Rebased.
@bors r=llogiq

@bors
Copy link
Collaborator

bors commented Oct 21, 2023

📌 Commit d6fc606 has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 21, 2023

⌛ Testing commit d6fc606 with merge 56c8235...

@bors
Copy link
Collaborator

bors commented Oct 21, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 56c8235 to master...

@bors bors merged commit 56c8235 into rust-lang:master Oct 21, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential FN with map_identity lint
4 participants