-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #84980
Merged
Merged
Update Clippy #84980
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Better suggestions when returning macro calls. Suggest changeing all the break expressions in a loop, not just the final statement. Don't lint divergent functions. Don't suggest returning the result of any divergent fuction.
- Add clippy_dev to the rust workspace Before, it would give an error that it wasn't either included or excluded from the workspace: ``` error: current package believes it's in a workspace when it's not: current: /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml workspace: /home/joshua/rustc/Cargo.toml this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest. ``` - Change clippy's copy of compiletest not to special-case rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find the test outputs. This is one of the reasons why `cargo dev bless` used to silently do nothing (the others were that `CARGO_TARGET_DIR` and `PROFILE` weren't set appropriately). - Run clippy_dev on test failure I tested this by removing a couple lines from a stderr file, and they were correctly replaced. - Fix clippy_dev warnings
These should still obey deny-warnings.
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/tools/clippy/clippy_lints/src/matches.rs:1595:53 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I don't have a minimised testcase because I don't have time to reduce libstd down to a few lines right now.
fix ice when checking rustc libstd ``` thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/tools/clippy/clippy_lints/src/matches.rs:1595:53 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` I don't have a minimised testcase because I don't have time to reduce libstd down to a few lines right now. --- changelog: fix index out of bounds access when checking rustc libstd
Don't rebuild rustdoc and clippy after checking bootstrap This works by unconditionally passing -Z unstable-options to the compiler. This has no affect in practice since bootstrap doesn't use `deny(rustc::internal)`. Fixes rust-lang#82461. r? ```@Mark-Simulacrum```
Implement `x.py test src/tools/clippy --bless` - Add clippy_dev to the rust workspace Before, it would give an error that it wasn't either included or excluded from the workspace: ``` error: current package believes it's in a workspace when it's not: current: /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml workspace: /home/joshua/rustc/Cargo.toml this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest. ``` - Change clippy's copy of compiletest not to special-case rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find the test outputs. This is one of the reasons why `cargo dev bless` used to silently do nothing (the others were that `CARGO_TARGET_DIR` and `PROFILE` weren't set appropriately). - Run clippy_dev on test failure I tested this by removing a couple lines from a stderr file, and they were correctly replaced. - Fix clippy_dev warnings
Remove leftover plugin conf_file code changelog: none Removes dead code that used to support the following syntax: ```rust #![plugin(clippy(conf_file="path/to/clippy's/configuration"))] ``` RLS (and others?) will need to remove the `&[]` from `clippy_lints::read_conf(&[], sess)`. r? `@flip1995`
…on-chain, r=giraffate Fix a false-positive inside const fn in `comparison_chain` closes rust-lang/rust-clippy#7082 changelog: fix a false-positive inside const fn in [`comparison_chain`]
…enkov Implement RFC 1260 with feature_name `imported_main`. This is the second extraction part of rust-lang#84062 plus additional adjustments. This (mostly) implements RFC 1260. However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure. cc rust-lang#28937 r? `@petrochenkov`
`implicit_return` improvements fixes: rust-lang#6940 changelog: Fix `implicit_return` suggestion for async functions changelog: Improve `implicit_return` suggestions when returning the result of a macro changelog: Check for `break` expressions inside a loop which are then implicitly returned changelog: Allow all diverging functions in `implicit_return`, not just panic functions
…flip1995 while_immutable_cond: check condition for mutation This fixes rust-lang#6689 by also checking the bindings mutated in the condition, whereas it was previously only checked in the loop body. --- changelog: Fix FP in [`while_immutable_cond`] where mutation in the loop variable wasn't picked up.
Small fix in CONTRIBUTING.md This is a section for `IntelliJ Rust`, not `rust-analyzer`. changelog: none
`Conf` macro improvements changelog: Allow `default_trait_access` in macros Mainly this is a change to use serde as in [Manually implementing Deserialize for a struct](https://serde.rs/deserialize-struct.html), which opens the door for a cleaner implementation overall. * Allow `default_trait_access` in macros (tangential, but used in this PR) * Deserialize into `TryConf { conf, errors }` instead of using a global `ERRORS` variable. * Improve the `define_Conf!` macro * Remove the redundant string literal `(name, "name", ..)` * Support deprecated configs with `#[conf_deprecated(message)]`. Message shows in error. * Make the default value optional. Use `Default::default()` if omitted. * Invalid config value error now shows the key (see test output) * Cleaner `impl Default for Conf` (no `toml::from_str("")`)
Fix unnecessary_filter_map false positive changelog: Fix an [`unnecessary_filter_map`] false positive Fixes rust-lang#6804
…llogiq Refactor: arrange lints in misc_early module This PR arranges misc_early lints so that they can be accessed more easily. Basically, I refactored them following the instruction described in rust-lang#6680. cc: `@Y-Nak,` `@flip1995,` `@magurotuna` changelog: Move lints in misc_early module into their own modules.
…onfig_doc, r=flip1995 Add a missing lint to MSRV config doc A follow-up of rust-lang/rust-clippy#6859. changelog: Add a missing lint to MSRV config doc
Rustup r? `@ghost` changelog: none
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
May 6, 2021
@bors rollup=iffy (Updates |
@bors r+ |
📌 Commit c24058b has been approved by |
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
May 6, 2021
☀️ Test successful - checks-actions |
rust-highfive
added a commit
to rust-lang-nursery/rust-toolstate
that referenced
this pull request
May 7, 2021
Tested on commit rust-lang/rust@770792f. Direct link to PR: <rust-lang/rust#84980> 💔 rls on windows: test-pass → build-fail (cc @Xanewok). 💔 rls on linux: test-pass → build-fail (cc @Xanewok).
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bi-weekly Clippy update.
r? @Manishearth