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

Downgrade implicit_hasher to pedantic #5411

Merged
merged 1 commit into from
Apr 8, 2020
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Apr 3, 2020

From the documentation, this lint is intended to suggest:

- pub fn foo(map: &mut HashMap<i32, i32>) { }

+ pub fn foo<S: BuildHasher>(map: &mut HashMap<i32, i32, S>) { }

I think this is pedantic. I get that this lint can benefit core libraries like serde, but that's exactly the use case for pedantic lints; a library like serde will enable clippy_pedantic and take the time to go through everything possible. Similar for libraries doing a libz blitz style checkup before committing to a 1.0 release; it would make sense to run through all the available pedantic lints then.

But otherwise, for most codebases and certainly for industrial codebases, the above suggested change just makes the codebase more obtuse for questionable benefit.

changelog: Remove implicit_hasher from default set of enabled lints

Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

Agreed. I also hit this lint in small code bases sometimes and think for my self "Yeah, I could do this, but that isn't necessary for my use-case at all" and then just allow it. Waiting for GHA to get fixed.

@flip1995 flip1995 added the S-waiting-on-bors Status: The marked PR was approved and is only waiting bors label Apr 4, 2020
@flip1995
Copy link
Member

flip1995 commented Apr 7, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 7, 2020

📌 Commit 0982b67 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Apr 7, 2020

🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened

bors added a commit that referenced this pull request Apr 8, 2020
Rollup of 12 pull requests

Successful merges:

 - #5345 (Add lint for float in array comparison)
 - #5406 (Fix update_lints)
 - #5409 (Downgrade let_unit_value to pedantic)
 - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic)
 - #5412 (Downgrade inefficient_to_string to pedantic)
 - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`)
 - #5417 (Update doc links and mentioned names in docs)
 - #5419 (Downgrade unreadable_literal to pedantic)
 - #5420 (Downgrade new_ret_no_self to pedantic)
 - #5422 (CONTRIBUTING.md: fix broken triage link)
 - #5424 (Incorrect suspicious_op_assign_impl)
 - #5425 (Ehance opt_as_ref_deref lint.)

Failed merges:

 - #5411 (Downgrade implicit_hasher to pedantic)
 - #5428 (Move cognitive_complexity to nursery)

r? @ghost

changelog: rollup
bors added a commit that referenced this pull request Apr 8, 2020
Rollup of 11 pull requests

Successful merges:

 - #5406 (Fix update_lints)
 - #5409 (Downgrade let_unit_value to pedantic)
 - #5410 (Downgrade trivially_copy_pass_by_ref to pedantic)
 - #5412 (Downgrade inefficient_to_string to pedantic)
 - #5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`)
 - #5417 (Update doc links and mentioned names in docs)
 - #5419 (Downgrade unreadable_literal to pedantic)
 - #5420 (Downgrade new_ret_no_self to pedantic)
 - #5422 (CONTRIBUTING.md: fix broken triage link)
 - #5424 (Incorrect suspicious_op_assign_impl)
 - #5425 (Ehance opt_as_ref_deref lint.)

Failed merges:

 - #5345 (Add lint for float in array comparison)
 - #5411 (Downgrade implicit_hasher to pedantic)
 - #5428 (Move cognitive_complexity to nursery)

r? @ghost

changelog: rollup
@bors
Copy link
Contributor

bors commented Apr 8, 2020

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

@flip1995
Copy link
Member

flip1995 commented Apr 8, 2020

@dtolnay a rebase is required after the rollup #5438

@bors
Copy link
Contributor

bors commented Apr 8, 2020

🔒 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 hasher (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 hasher --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 src/lintlist/mod.rs
Auto-merging clippy_lints/src/types.rs
Auto-merging clippy_lints/src/lib.rs
CONFLICT (content): Merge conflict in clippy_lints/src/lib.rs
Automatic merge failed; fix conflicts and then commit the result.

@dtolnay
Copy link
Member Author

dtolnay commented Apr 8, 2020

Rebased.

@flip1995
Copy link
Member

flip1995 commented Apr 8, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Apr 8, 2020

📌 Commit 5f92fae has been approved by flip1995

@bors
Copy link
Contributor

bors commented Apr 8, 2020

⌛ Testing commit 5f92fae with merge c25f26d...

@bors
Copy link
Contributor

bors commented Apr 8, 2020

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

@bors bors merged commit c25f26d into rust-lang:master Apr 8, 2020
@dtolnay dtolnay deleted the hasher branch April 8, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants