Skip to content

New lint [tuple_array_conversions]#11020

Merged
bors merged 4 commits into
rust-lang:masterfrom
Centri3:tuple_array_conversion
Jul 1, 2023
Merged

New lint [tuple_array_conversions]#11020
bors merged 4 commits into
rust-lang:masterfrom
Centri3:tuple_array_conversion

Conversation

@Centri3

@Centri3 Centri3 commented Jun 24, 2023

Copy link
Copy Markdown
Member

Closes #10748

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

changelog: New lint [tuple_array_conversions]

@rustbot

rustbot commented Jun 24, 2023

Copy link
Copy Markdown
Collaborator

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

llogiq commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

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

bors commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

📌 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

bors commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit 1090bf3 with merge d864b13...

@bors

bors commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

💔 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

bors commented Jun 27, 2023

Copy link
Copy Markdown
Contributor

☔ 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

Centri3 commented Jun 29, 2023

Copy link
Copy Markdown
Member Author

@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

bors commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

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

@bors

bors commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

📌 Commit eeb3d96 has been approved by llogiq

It is now in the queue for this repository.

@bors

bors commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

🔒 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

llogiq commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

@bors r-

Please rebase.

@Centri3

Centri3 commented Jun 29, 2023

Copy link
Copy Markdown
Member Author

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

llogiq commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

📌 Commit 826edd7 has been approved by llogiq

It is now in the queue for this repository.

@bors

bors commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit 826edd7 with merge c7bf05c...

@bors

bors commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

☀️ 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

kupiakos commented Jul 8, 2023

Copy link
Copy Markdown

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