Skip to content

[redundant_closure]: special case inclusive ranges #10905

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

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

y21
Copy link
Member

@y21 y21 commented Jun 7, 2023

Fixes #10684.

x..=y ranges need a bit of special handling in this lint because it desugars to a call to the lang item RangeInclusiveNew, where the callee span would be the same as the range expression itself, so the suggestion looked a bit weird. It now correctly suggests RangeInclusive::new.

changelog: [redundant_closure]: special case RangeInclusive

@rustbot
Copy link
Collaborator

rustbot commented Jun 7, 2023

r? @Alexendoo

(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 7, 2023
@Alexendoo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 8, 2023

📌 Commit 9ff34ac has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jun 8, 2023

⌛ Testing commit 9ff34ac with merge b7c330f...

@bors
Copy link
Contributor

bors commented Jun 8, 2023

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

@bors bors merged commit b7c330f into rust-lang:master Jun 8, 2023
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.

redundant_closure when using RangeInclusive syntax
4 participants