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

New lint [tuple_array_conversions] #11020

Merged
merged 4 commits into from
Jul 1, 2023

Conversation

Centri3
Copy link
Member

@Centri3 Centri3 commented Jun 24, 2023

Closes #10748

PS, the implementation is a bit ugly 😅 I will likely refactor soon enough :) Done :D

changelog: New lint [tuple_array_conversions]

@rustbot
Copy link
Collaborator

rustbot commented Jun 24, 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 24, 2023
@Centri3 Centri3 force-pushed the tuple_array_conversion branch from 78dc48e to 1090bf3 Compare June 24, 2023 15:13
@llogiq
Copy link
Contributor

llogiq commented Jun 24, 2023

Looks good to me. Thank you!

Could we determine whether type annotations are needed and otherwise shorten the help text? In any event, that could be a follow-up PR.

@bors r+

@bors
Copy link
Contributor

bors commented Jun 24, 2023

📌 Commit 1090bf3 has been approved by llogiq

It is now in the queue for this repository.

bors added a commit that referenced this pull request Jun 24, 2023
New lint [`tuple_array_conversions`]

Closes #10748

PS, the implementation is a bit ugly 😅 ~~I will likely refactor soon enough :)~~ Done :D

changelog: New lint [`tuple_array_conversions`]
@bors
Copy link
Contributor

bors commented Jun 24, 2023

⌛ Testing commit 1090bf3 with merge d864b13...

@bors
Copy link
Contributor

bors commented Jun 24, 2023

💔 Test failed - checks-action_test

@Centri3 Centri3 force-pushed the tuple_array_conversion branch from 1090bf3 to 4b67478 Compare June 25, 2023 00:20
@bors
Copy link
Contributor

bors commented Jun 27, 2023

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

@Centri3 Centri3 force-pushed the tuple_array_conversion branch 2 times, most recently from 5633821 to 6198a09 Compare June 27, 2023 21:16
@Centri3
Copy link
Member Author

Centri3 commented Jun 29, 2023

@llogiq, CI unfortunately failed because of collect-metadata. It should pass now.

@Centri3 Centri3 force-pushed the tuple_array_conversion branch from 6198a09 to eeb3d96 Compare June 29, 2023 07:23
@bors
Copy link
Contributor

bors commented Jun 29, 2023

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

@bors
Copy link
Contributor

bors commented Jun 29, 2023

📌 Commit eeb3d96 has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jun 29, 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 tuple_array_conversion (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 tuple_array_conversion --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 clippy_utils/src/msrvs.rs
CONFLICT (content): Merge conflict in clippy_utils/src/msrvs.rs
Auto-merging clippy_lints/src/utils/conf.rs
CONFLICT (content): Merge conflict in clippy_lints/src/utils/conf.rs
Auto-merging book/src/lint_configuration.md
Automatic merge failed; fix conflicts and then commit the result.

@llogiq
Copy link
Contributor

llogiq commented Jun 29, 2023

@bors r-

Please rebase.

@Centri3
Copy link
Member Author

Centri3 commented Jun 29, 2023

Was just about to :D

@Centri3 Centri3 force-pushed the tuple_array_conversion branch from eeb3d96 to 826edd7 Compare June 29, 2023 11:46
@llogiq
Copy link
Contributor

llogiq commented Jul 1, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jul 1, 2023

📌 Commit 826edd7 has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 1, 2023

⌛ Testing commit 826edd7 with merge c7bf05c...

@bors
Copy link
Contributor

bors commented Jul 1, 2023

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

@bors bors merged commit c7bf05c into rust-lang:master Jul 1, 2023
@kupiakos
Copy link

kupiakos commented Jul 8, 2023

Given the line let (a, b) = (buf[0], buf[1]);, I would not replace it with let (a, b) = buf.into(); as this lints suggests, but instead write let [a, b] = buf;. The goal is not to convert to a tuple, it's to get multiple bindings.

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.

Simpler tuple <=> array conversions
5 participants