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

Closed
wants to merge 156 commits into from
Closed

Update Clippy #91154

wants to merge 156 commits into from

Conversation

flip1995
Copy link
Member

r? @Manishearth

Delayed Clippy sync. I didn't get to it over the weekend..

Michael Wright and others added 30 commits November 1, 2021 06:12
…, r=flip1995

Reference `clippy_utils` docs on nightly-rustc and some other documentation updates

The `clippy_utils` crate is now part of the nightly-rustc documentation. See [**very beautiful documentation**](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/). This PR references them in our documentation and updates some other documentation.

changelog: none
Fix false negative in [`match_overlapping_arms`]

changelog: Fix false negative in [`match_overlapping_arms`]
Replace `in_macro` usage with `from_expansion`

changelog: none

Generally replace `in_macro(span)` with `span.from_expansion()`. If we're just trying to avoid expanded code, this seems more appropriate because any kind of expanded code is prone to false positives. One place I did not touch is `macro_use.rs`. I think this lint could use a rewrite so I moved `in_macro` there, the only place it is still used.
…shearth

Remove rustfmt::skip attribute from register_plugins function

r? `@Manishearth` since you added this in rust-lang#540 😄

changelog: none
I found the manual run command really useful, this makes it a bit easier
to type
…effen

Extend author lint

changelog: none

* Print float and int suffixes
* Print labels
* Struct field checks
* Repeat length expression check
* Destructure method calls
* Destructure closures
Add `cargo dev lint` to manually run clippy on a file

I found the manual run command really useful, this makes it a bit easier to type

Not sure if this belongs in the changelog or not

changelog: Add `cargo dev lint` to manually run clippy on a file
TraitKind -> Trait
TyAliasKind -> TyAlias
ImplKind -> Impl
FnKind -> Fn

All `*Kind`s in AST are supposed to be enums.

Tuple structs are converted to braced structs for the types above, and fields are reordered in syntactic order.

Also, mutable AST visitor now correctly visit spans in defaultness, unsafety, impl polarity and constness.
The only reason to use `abort_if_errors` is when the program is so broken that either:
1. later passes get confused and ICE
2. any diagnostics from later passes would be noise

This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints.
So it can continue to lint and compile even if there are lint errors.
Fix ICE in undocumented_unsafe_blocks

changelog: Fix ICE in [`undocumented_unsafe_blocks`]

closes: rust-lang#7934
Introduce `expr_visitor` and `expr_visitor_no_bodies`

changelog: none

A couple utils that satisfy a *lot* of visitor use cases. Factoring in every possible usage would be really big so I just focused on cleaning clippy_utils.
Rustup

Re-sync, because I didn't get to syncing things back to rustc.

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 Nov 23, 2021
@rust-log-analyzer

This comment has been minimized.

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 23, 2021

📌 Commit b95545b 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 Nov 23, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 23, 2021
Update Clippy

r? `@Manishearth`

Delayed Clippy sync. I didn't get to it over the weekend..
@matthiaskrgr
Copy link
Member

@bors p=1 (kinda bitrotty)

@bors
Copy link
Contributor

bors commented Nov 24, 2021

⌛ Testing commit b95545b with merge 64a23715ae719461cd7759c26ed1a98f513e540a...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    |
note: function defined here
   --> /checkout/src/tools/clippy/clippy_lints/src/lib.rs:414:8
    |
414 | pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) {

For more information about this error, try `rustc --explain E0061`.
[RUSTC-TIMING] rls_rustc test:false 0.420
error: could not compile `rls-rustc` due to previous error
---
Verifying status of rls...
Verifying status of miri...
Verifying status of embedded-book...
Cloning into 'rust-toolstate'...
error: Tool `rls` has regressed from test-pass to build-fail during beta week.
{"rust-by-example":"test-pass","rustbook":"test-fail","embedded-book":"test-pass","book":"test-pass","edition-guide":"test-pass","reference":"test-pass","nomicon":"test-pass","miri":"test-pass","cargo-miri":"test-fail","rls":"build-fail"}Build completed unsuccessfully in 0:00:00

@bors
Copy link
Contributor

bors commented Nov 24, 2021

💔 Test failed - checks-actions

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

error[E0061]: this function takes 3 arguments but 1 argument was supplied
   --> src/tools/rls/rls-rustc/src/clippy.rs:62:9
    |
62  |         clippy_lints::register_pre_expansion_lints(&mut lint_store);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- supplied 1 argument
    |         |
    |         expected 3 arguments

Did this function change?

@flip1995
Copy link
Member Author

Yes 413d255 changed that function. So we will have to do a RLS sync first.

@flip1995
Copy link
Member Author

Ohoh, we can't update RLS, because we can't bump the Clippy version, because the Clippy packages have edition 2021, so cargo complains that it can't find them:

cargo update -p clippy_lints
    Updating git repository `https://github.com/rust-lang/rust-clippy`
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/rust-clippy`
error: no matching package named `clippy_lints` found
location searched: https://github.com/rust-lang/rust-clippy?rev=0c8799da5aabf72aee26053075d2bd73ef9f7789
required by package `rls v1.41.0 (/home/pkrones/rust-lang/rls)`

Let's investigate...

@flip1995
Copy link
Member Author

Since we missed the time frame to get this into this release, I will close this in favor of the sync I'll do on Thursday.

@flip1995 flip1995 closed this Nov 30, 2021
@flip1995 flip1995 deleted the clippyup branch November 30, 2021 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-clippy Area: Clippy S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.