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

Update Clippy #77144

Merged
merged 104 commits into from
Sep 25, 2020
Merged

Update Clippy #77144

merged 104 commits into from
Sep 25, 2020

Conversation

flip1995
Copy link
Member

Bi-weekly Clippy update.

This includes a Cargo.lock update (d445493), so probably needs rollup=never.

r? @Manishearth

Vali Schneider and others added 30 commits August 27, 2020 16:18
…eachable or panic in a function of type result or option
* Remove the mention to `Rc` and `Arc` as these are `Freeze`
  so the lint correctly handles already.

* Instead, explain what could cause a false positive,
  and mention `bytes` as an example.
…ip1995

update cargo dev ra-setup to changed rustc source paths

changelog: none
… r=flip1995

Improve the "known problems" section of `interior_mutable_key`

* Remove the mention to `Rc` and `Arc` as these are `Freeze` (despite my intuition) so the lint correctly handles already.
* Instead, explain what could cause a false positive, and mention `bytes` as an example.

---

changelog: Improved the "known problems" section of `interior_mutable_key`
bors and others added 16 commits September 18, 2020 14:34
…st, r=flip1995

Change the criteria of `interior_mutable_const`

This implements my suggestion [here](rust-lang/rust-clippy#5050 (comment)), and so hopefully fixes rust-lang#5050.

* stop linting associated types and generic type parameters
* start linting ones in trait impls
  whose corresponding definitions in the traits are generic
* remove the `is_copy` check
  as presumably the only purpose of it is to allow
  generics with `Copy` bounds as `Freeze` is internal
  and generics are no longer linted
* remove the term 'copy' from the tests
  as being `Copy` no longer have meaning

---

changelog: Change the criteria of `declare_interior_mutable_const` and `borrow_interior_mutable_const` to narrow the lints to only lint things that defenitly is a interior mutable type, not potentially.
Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts.
Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.
`is_ok` and `is_err` are stabilized as const and can thus always be suggested.
Co-authored-by: Ralf Jung <post@ralfj.de>
Stabilize some Result methods as const

Stabilize the following methods of Result as const:
 - `is_ok`
 - `is_err`
 - `as_ref`

A test is also included, analogous to the test for `const_option`.

These methods are currently const under the unstable feature `const_result` (tracking issue: rust-lang#67520).
I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463) and [PR#76135](rust-lang#76135).

Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature.

Related: rust-lang#76225
Update the test `redundant_pattern_matching`: check if `is_some` and `is_none` are suggested within const contexts.
Removes `can_suggest` from as it is no longer used.
Reverts rust-clippy#5724.
This is to avoid the 200 lines stderr file limit
Rustup

r? `@ghost`

changelog: none
…-macro, r=Manishearth

Forbid redundant_pattern_matching triggering in macros

fixes rust-lang#6065

changelog: forbid redundant_pattern_matching triggering in macros
We can avoid the data copy again by fixing rustc_ast::ast::LitKind
later.
Add `rc_buffer` lint for checking Rc<String> and friends

Fixes rust-lang#2623

This is a bit different from the original PR attempting to implement this type of lint.   Rather than linting against converting into the unwanted types, this PR lints against declaring the unwanted type in a struct or function definition.

I'm reasonably happy with what I have here, although I used the fully qualified type names for the Path and OsString suggestions, and I'm not sure if I should have just used the short versions instead, even if they might not have been declared via use.

Also, I don't know if "buffer type" is the best way to put it or not.  Alternatively I could call it a "growable type" or "growable buffer type", but I was thinking of PathBuf when I started making the lint.

changelog: Add `rc_buffer` lint
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2020
@Manishearth
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Sep 24, 2020

📌 Commit d445493 has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2020
@bors
Copy link
Contributor

bors commented Sep 25, 2020

⌛ Testing commit d445493 with merge fadf025...

@bors
Copy link
Contributor

bors commented Sep 25, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Manishearth
Pushing fadf025 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 25, 2020
@bors bors merged commit fadf025 into rust-lang:master Sep 25, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 25, 2020
@flip1995 flip1995 deleted the clippyup branch September 25, 2020 11:40
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 2020
Update Clippy

Bi-weekly Clippy update.

This includes a `Cargo.lock` update (d445493), so probably needs `rollup=never`.

r? `@Manishearth`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.