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

Potentially redundant/upliftable lints #2846

Open
clarfonthey opened this issue Jun 14, 2018 · 2 comments
Open

Potentially redundant/upliftable lints #2846

clarfonthey opened this issue Jun 14, 2018 · 2 comments
Milestone

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Jun 14, 2018

A few lints I noticed which may be redundant to newer lints in rustc upstream:

  • absurd_extreme_comparisons should be uplifted to the existing unused_comparisons
  • bad_bit_mask should probably be uplifted to the existing unused_comparisons lint, or an unused_bitmask lint
  • bool_comparison should probably be uplifted to unused_comparisons
  • cmp_nan should probably be again uplifted to unused_comparisons
  • eq_op should probably be again uplifted to unused_comparisons
  • unused_collect should be replaced by the existing must_use on collect
  • useless_attribute should be replaced by unused_attribute
  • out_of_bounds_indexing should be a const eval error
  • iterator_step_by_zero should be removed; this now panics
  • enum_clike_unportable_variant should be part of a compiler portability lint

(will make larger list when I get around to it)

@Manishearth
Copy link
Member

FWIW collect already has must_use, this must have happened in the recentish flurry of PRs adding must_use everywhere. So we can remove this lint if nobody objects.

As for absurd_extreme_comparisons, the clippy lint is better, we should probably uplift the goodies we have.

@clarfonthey clarfonthey changed the title Potentially redundant lints Potentially redundant/upliftable lints Jun 16, 2018
@clarfonthey
Copy link
Contributor Author

clarfonthey commented Jun 16, 2018

So as I'm going through a bunch of lints… there are a lot of lints which could just be added to the existing, upstream unused_comparisons lint. A lot of these are super easy to check, with a huge net gain for checking. Plus, I can't see why someone would want to disable them individually, considering how they're very straightforward.

Perhaps the bad_bit_mask lint would be a bit too much for upstream rustc, but a lot of the others would be very good to add upstream.

@phansch phansch added this to the 1.0 milestone Jun 20, 2018
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 7, 2019
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc rust-lang#2846
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 7, 2019
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc rust-lang#2846
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 7, 2019
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc rust-lang#2846
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 14, 2019
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc rust-lang#2846
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 14, 2019
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc rust-lang#2846
bors added a commit that referenced this issue Aug 15, 2019
…1995

Deprecate unused_collect lint

I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by rustc's `#[must_use]` on `collect`

cc #2846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants