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

Don't lint let_unit_value when () is explicit #10844

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

Centri3
Copy link
Member

@Centri3 Centri3 commented May 30, 2023

since these are explicitly written (and not the result of a function call or anything else), they should be allowed, as they are both useful in some cases described in #9048

Fixes #9048

changelog: [let_unit_value]: Don't lint when () is explicit

@rustbot
Copy link
Collaborator

rustbot commented May 30, 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 May 30, 2023
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on, also I much like the additions to the tests. One thing that befuddled me is why did you regress from a let chain to an if_chain! macro invocation?

clippy_lints/src/unit_types/let_unit_value.rs Outdated Show resolved Hide resolved
clippy_lints/src/unit_types/let_unit_value.rs Outdated Show resolved Hide resolved
tests/ui/let_unit.fixed Outdated Show resolved Hide resolved
@bors
Copy link
Collaborator

bors commented Aug 11, 2023

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

@Alexendoo
Copy link
Member

r=me with rebase/squash

@kupiakos
Copy link

Any chance this can be rebased and merged?

@cocodery
Copy link
Contributor

I have tried locally, merging master branch and solving one small conflict will be fine.
And related Issue#12017 can tag fixed in the first comment.
@Centri3

@Alexendoo
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 5, 2024

📌 Commit 81f16d8 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 5, 2024

⌛ Testing commit 81f16d8 with merge 43f39b5...

bors added a commit that referenced this pull request Jan 5, 2024
Don't lint `let_unit_value` when `()` is explicit

since these are explicitly written (and not the result of a function call or anything else), they should be allowed, as they are both useful in some cases described in #9048

Fixes #9048

changelog: [`let_unit_value`]: Don't lint when `()` is explicit
@bors
Copy link
Collaborator

bors commented Jan 5, 2024

💔 Test failed - checks-action_dev_test

@Alexendoo
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 5, 2024

📌 Commit fd9d330 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 5, 2024

⌛ Testing commit fd9d330 with merge 394f63f...

@bors
Copy link
Collaborator

bors commented Jan 5, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 394f63f to master...

@bors bors merged commit 394f63f into rust-lang:master Jan 5, 2024
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.

let_unit_value should be allowed when I explicitly write "let () = ..."
8 participants