Skip to content

Update Clippy #89617

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

Merged
merged 82 commits into from
Oct 7, 2021
Merged

Update Clippy #89617

merged 82 commits into from
Oct 7, 2021

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Oct 7, 2021

asquared31415 and others added 30 commits September 14, 2021 18:47
Co-authored-by: Cameron Steffen <[email protected]>
Improve depinfo error

changelog: none

r? `@flip1995`
…ffen

Make `doc_unsafe` warn on unsafe traits as well

Fixes rust-lang#7732

changelog: Make [`doc_unsafe`] warn on unsafe traits as well
Fix typo ("asynx" corrected to "async")

changelog: Fixed small typo in [`await_holding_lock`]'s documentation - "asynx" was corrected to "async"
Also change the generation functions to return `String` instead of
`Vec<String>`. This makes sense now as the updates aren't line oriented
anymore.
…dit method is_default_equivalent() to satisfy with this.
Co-authored-by: Takayuki Nakata <[email protected]>
…affate

Move code generated by `update_lints` to includes

Move code generated by `update_lints` to includes

changelog: none
…1995

fix for issue rust-lang#7683

Fixes rust-lang#7683.

For Repeat  [x; y] (x is the type and y is the times to repeat) . When y > 32, the compiler will report an error:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7148558162685e91056e0550797ea74c

Because https://github.com/rust-lang/rust/blob/6cdd42f9f8dd4e5e5ba0aa816bc4c99ab8b102f9/library/std/src/primitive_docs.rs#L538
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
/// if the element type allows it. As a stopgap, trait implementations are
/// statically generated up to size 32.

So here to detect this situation.

changelog: [`derivable_impls`]: No longer lints when arrays bigger than 32 elements are involved
Make if_then_else handle situation of cond.kind = ExprKind::DropTemps(ExprKind::Binary(BinOpKind::And || BinOpKind::Or, left, right), ..) =
…msteffen

fix bug for large_enum_variants

Fix the discussion problem in the issue of rust-lang/rust-clippy#7666 (comment)

About the false positive problem of case:
```rust
enum LargeEnum6 {
    A,
    B([u8;255]),
    C([u8;200]),
}
```

changelog: Fix largest_enum_variant wrongly identifying the second largest variant.
Re-write shadow lints

changelog: Move shadow_unrelated to restriction
changelog: The shadow lints find a lot more shadows and are not limited to certain patterns

Drastically simplifies the implementation. Catches a lot more cases.

I removed the "initialization happens here" note. It is not helpful IMO.

Closes rust-lang#318
Fixes rust-lang#2890
Fixes rust-lang#6563
Fixes rust-lang#7588
Fixes rust-lang#7620
Fix ICE when `start` lang item has wrong generics

In my previous pr rust-lang#87875 I missed the requirements on the `start` lang item due to its relative difficulty to test and opting for more conservative estimates.  This fixes that by updating the requirement to be exactly one generic type.

The `start` lang item should have exactly one generic type for the return type of the `main` fn ptr passed to it.  I believe having zero would previously *sometimes* compile (often with the use of `fn() -> ()` as the fn ptr but it was likely UB to call if the return type of `main` was not `()` as far as I know) however it also sometimes would not for various errors including ICEs and LLVM errors depending on exact situations.  Having more than 1 generic has always failed with an ICE because only the one generic type is expected and provided.

Fixes rust-lang#79559, fixes rust-lang#73584, fixes rust-lang#83117 (all duplicates)
Relevant to rust-lang#9307

r? ````@cjgillot````
Manishearth and others added 17 commits October 6, 2021 00:12
Move module declarations back into lib.rs

With rust-lang#7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case).

With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs.

changelog: none
Useless exponent

Closes rust-lang#7745

I'm open to some thoughts on dropping the exponents on suggestions when it's zero. I personally don't see any problem on this.

changelog: [`useless_exponent`] suggestion drops exponent when exponent value is zero
I'm not sure whether I should add links to `bool`, `char`, and `str`. `slice` could also be linked to.
Fix typos

I'm not sure whether I should add links to `bool`, `char`, and `str`. `slice` could also be linked to.

changelog: none
…teffen

Handle intra-doc links in doc_markdown

Fixes rust-lang#7758

changelog: Handle intra-doc links in [`doc_markdown`]
This commit reverts the module list generation code to what it was
before the change to `include!` it and generates better output.
…ogiq

Revert `update_lints` module list generating code

This commit reverts the module list generation code to what it was
before the change to `include!` it and generates better output.

changelog: none
Rustup

r? `@ghost`

Finally an easy, conflict free rustup again 🎉

changelog: none
@rust-highfive
Copy link
Contributor

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 Oct 7, 2021
@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Oct 7, 2021

📌 Commit 333a06a 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 Oct 7, 2021
@bors
Copy link
Collaborator

bors commented Oct 7, 2021

⌛ Testing commit 333a06a with merge 485ced5...

@bors
Copy link
Collaborator

bors commented Oct 7, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 485ced5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 7, 2021
@bors bors merged commit 485ced5 into rust-lang:master Oct 7, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 7, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (485ced5): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

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.