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 #86782

Merged
merged 135 commits into from
Jul 2, 2021
Merged

Update Clippy #86782

merged 135 commits into from
Jul 2, 2021

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Jul 1, 2021

Biweekly Clippy Update

r? @Manishearth

flip1995 and others added 30 commits May 4, 2021 16:48
Producing a good suggestion for this lint is already hard when no macros
are involved. With macros the lint message and the suggestion are just
confusing. Since both, producing a good suggestion and figuring out if
this pattern can be re-written inside a macro is nearly impossible, just
bail out.
Backport of rust-lang#7170 to beta

r? `@ghost`

changelog: none (fixes stack overflow, but this was introduced in this release cycle)

Now actually opened towards the `beta` branch.
This reverts commit 716d03f.

This is no longer necessary, since rustup 1.24.2 is now the default
version on the windows runner.
Revert "CI: update rustup before installing the toolchain on windows"

This reverts commit 716d03f.

This is no longer necessary, since rustup 1.24.2 is now the default
version on the windows runner.

changelog: none
Don't warn about `cfg!(..)` as a constant in assertions

This makes clippy understand that `cfg!(..)` is not just a hardcoded `true` or `false` (even though it expands to one of those).

cc `@khyperia`

changelog: Don't treat `cfg!(..)` as a constant in [`assertions-on-constants`]
…Manishearth

Fix needless_collect with binding shadowing

changelog: Fix [`needless_collect`] weird output when a binding is shadowed

Fixes rust-lang#7200
…xFrednet

Release doc: add explanation for updating the stable branch

r? `@xFrednet`

[Rendered](https://github.com/flip1995/rust-clippy/blob/doc-release-stable-branch/doc/release.md)

changelog: none
These macros have already been removed, but there was still some code
handling these macros. That code is now removed.
Fix FP in `default_numeric_fallback` with external macro expansion

fixes rust-lang#7304

changelog: Fix `default_numeric_fallback` FP with external macro expansion
…rednet,flip1995

fix `while_let_on_iterator` suggestion in a closure

fixes: rust-lang#7249

A future improvement would be to check if the closure is being used as `FnOnce`, in which case the original suggestion would be correct.

changelog: Suggest `&mut iter` inside a closure for `while_let_on_iterator`
camsteffen and others added 13 commits June 29, 2021 08:17
Simplify use_self impl

changelog: none

Mainly to remove an extra visit and simplify the "in body?" logic.
Improve lint message for match-same-arms lint

fixes rust-lang#7331

Follow-up to rust-lang#7377

This PR improves the lint message for `match-same-arms` lint and adds `todo!(..)`  example to the lint docs.

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

changelog: None
New lint: `disallowed_script_idents`

This PR implements a new lint to restrict locales that can be used in the code,
as proposed in rust-lang#7376.

Current concerns / unresolved questions:

- ~~Mixed usage of `script` (as a Unicode term) and `locale` (as something that is easier to understand for the broad audience). I'm not sure whether these terms are fully interchangeable and whether in the current form it is more confusing than helpful.~~ `script` is now used everywhere.
- ~~Having to mostly copy-paste `AllowedScript`. Probably it's not a big problem, as the list of scripts is standardized and is unlikely to change, and even if we'd stick to the `unicode_script::Script`, we'll still have to implement custom deserialization, and I don't think that it will be shorter in terms of the amount of LoC.~~ `unicode::Script` is used together with a filtering deserialize function.
- Should we stick to the list of "recommended scripts" from [UAX rust-lang#31](http://www.unicode.org/reports/tr31/#Table_Recommended_Scripts) in the configuration?

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

changelog: ``[`disallowed_script_idents`]``

r? `@Manishearth`
This fixes a bug where match_wildcard_for_single_variants produced a
bad suggestion where besides the missing variant, one or more hidden
variants were left.

This also adds tests to the ui-tests match_wildcard_for_single_variants
and wildcard_enum_match_arm to make sure that the correct suggestion is
produced.
Don't suggest doc(hidden) or unstable variants in wildcard lint

Clippy's wildcard lint would suggest doc(hidden) and unstable variants for non_exhaustive enums, even though those aren't part of the public interface (yet) and should only be matched on using a `_`, just like potential future additions to the enum. There was already some logic to exclude a *single* doc(hidden) variant. This extends that to all hidden variants, and also hides `#[unstable]` variants.

See rust-lang#85746 (comment)

This PR includes rust-lang/rust-clippy#7406 as the first commit.

Here's the diff that this PR adds on top of that PR: m-ou-se/fork@std-errorkind...m-ou-se:doc-hidden-variants

---

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

changelog: No longer suggest unstable and doc(hidden) variants in wildcard lint. wildcard_enum_match_arm, match_wildcard_for_single_variants
Rustup

r? `@ghost`

changelog: none
@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 1, 2021
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 1, 2021

📌 Commit 44cea51 has been approved by Manishearth

@flip1995
Copy link
Member Author

flip1995 commented Jul 1, 2021

@bors rollup=iffy (includes Cargo.lock update)

@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 Jul 1, 2021
@bors
Copy link
Contributor

bors commented Jul 2, 2021

⌛ Testing commit 44cea51 with merge 46ae6ee...

@bors
Copy link
Contributor

bors commented Jul 2, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 46ae6ee to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 2, 2021
@bors bors merged commit 46ae6ee into rust-lang:master Jul 2, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 2, 2021
@bors bors mentioned this pull request Jul 2, 2021
@flip1995 flip1995 deleted the clippyup branch July 2, 2021 08:54
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 15, 2021
Update Clippy

Biweekly Clippy Update

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.