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

Move needless_collect to nursery #9705

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

sophiajt
Copy link
Contributor

@sophiajt sophiajt commented Oct 24, 2022

Please write a short comment explaining your change (or "none" for internal only changes)

changelog: [needless_collect]: Move needless_collect to nursery (Now allow-by-default)

After chatting with a few folks, it seems like needless_collect is giving false positives pretty regularly (https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+needless_collect). We're big supporters of clippy in Nushell, and it's one of the passes we require for CI, but we've had to disable this particular lint. Perhaps it should be moved to the nursery until it's improved?

(apologies if this isn't the right approach to disabling a lint by default. I tried to follow the idea I saw other PRs doing in the past)

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 24, 2022
@Manishearth
Copy link
Member

cc @rust-lang/clippy

we probably can write up a plan for what it would take to enable it again

@Manishearth
Copy link
Member

(fwiw the typical procedure is to open an issue first and list prior issues and discussions, but this works too)

@sophiajt
Copy link
Contributor Author

For the tests failing in CI, should these tests be skipped by default, or is there another procedure for them?

@Jarcho
Copy link
Contributor

Jarcho commented Oct 24, 2022

You'll need to run cargo dev update_lints and add those changes.

@sophiajt
Copy link
Contributor Author

@Jarcho - I ran cargo dev update_lints, but it didn't change any files. Is there a step I need to do before that step?

@flip1995
Copy link
Member

flip1995 commented Oct 24, 2022

With #9541 lint re-categorizing got really simple it seems. Doesn't even require cargo dev update_lints anymore. Great work @Alexendoo !


@jntrnr The needless_collect_indirect.rs UI test doesn't have a #![warn(clippy::needless_collect] attribute, because the lint was a warn-by default lint before. Just add this attribute to the top of the test file and run cargo uitest followed by cargo dev bless and this should be good.


we probably can write up a plan for what it would take to enable it again

There are many issues open for this lint with a pretty detailed description of some significant FPs. I would say the plan to enable this lint again would be to fix those first. Some of them will be quite hard though, because they will involve predicting borrowing rules...

@Jarcho
Copy link
Contributor

Jarcho commented Oct 24, 2022

Didn't notice that one. Yay for less merge conflicts.

@sophiajt
Copy link
Contributor Author

@flip1995 - thanks, that fixed.

@Manishearth
Copy link
Member

There are many issues open for this lint with a pretty detailed description of some significant FPs. I would say the plan to enable this lint again would be to fix those first. Some of them will be quite hard though, because they will involve predicting borrowing rules...

Yeah I'm basically thinking we file an issue listing all the existing bugs, and also saying the general area of things that ought to be explored for further bugs before un-nurserying it.

@xFrednet
Copy link
Member

I favor of this move, the lint produces some FPs in another project of mine as well :)

@Manishearth
Copy link
Member

Everyone seems on board, I'm merging

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 7, 2022

📌 Commit 4f3fb00 has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 7, 2022

⌛ Testing commit 4f3fb00 with merge 213003b...

@bors
Copy link
Collaborator

bors commented Nov 7, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 213003b to master...

@bors bors merged commit 213003b into rust-lang:master Nov 7, 2022
@sophiajt sophiajt deleted the disable_needless_collect branch November 7, 2022 17:43
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.

None yet

7 participants