]>
git.lizzy.rs Git - rust.git/log
nahuakang [Mon, 8 Feb 2021 21:01:05 +0000 (22:01 +0100)]
Refactor check_for_loop_explicit_counter to its own module
nahuakang [Mon, 8 Feb 2021 20:38:00 +0000 (21:38 +0100)]
Refactor check_for_loop_range into its module
nahuakang [Mon, 8 Feb 2021 20:20:23 +0000 (21:20 +0100)]
Refactor check_for_mut_range_bound to its own module
nahuakang [Mon, 8 Feb 2021 20:04:33 +0000 (21:04 +0100)]
Refactor check_for_loop_over_map_kv to its own module
nahuakang [Mon, 8 Feb 2021 19:47:35 +0000 (20:47 +0100)]
Refactor check_for_loop_arg; rename manual_flatten's lint back to check_manual_flatten
nahuakang [Sun, 7 Feb 2021 12:35:27 +0000 (13:35 +0100)]
create loops dir; arrange manual_flatten lint and utils
bors [Tue, 2 Mar 2021 08:57:11 +0000 (08:57 +0000)]
Auto merge of #6822 - camsteffen:rustfmt, r=llogiq
Rustfmt version "Two"
changelog: none
This enables some ~bug fixes~ changes from rustfmt. This is more consistent with rustc's config, and should be more forward-compatible. Also, the changes look good IMO. 😃
Jason Newcomb [Tue, 2 Mar 2021 03:55:26 +0000 (22:55 -0500)]
Use diagnostic or language items instead of paths
Jason Newcomb [Mon, 1 Mar 2021 22:25:23 +0000 (17:25 -0500)]
Don't move `yield` or inline assembly into closure
Cameron Steffen [Mon, 1 Mar 2021 17:53:33 +0000 (11:53 -0600)]
Add version = "Two" to rustfmt.toml
Ignore UI tests since this change makes rustfmt less friendly with UI
test comments.
bors [Mon, 1 Mar 2021 11:37:08 +0000 (11:37 +0000)]
Auto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995
lintcheck, do some refactoring and add more sources
refactor: add a Config object
don't run in parallel mode by default (it didn't make sense because cargo would lock the shared target dir anyway)
show full paths (from repo root) to the source files in clippy warnings so we can just copy the path from the logfile
fix more bugs
add more crates by dtolnay and embark to the sources toml
changelog: lintcheck: refactor some code and add more sources
Matthias Krüger [Sun, 28 Feb 2021 12:59:47 +0000 (13:59 +0100)]
update lintcheck_crates logs and fix typos
Matthias Krüger [Sun, 28 Feb 2021 12:52:26 +0000 (13:52 +0100)]
lintcheck: add more embark crate sources to the sources toml
Matthias Krüger [Sun, 28 Feb 2021 11:36:56 +0000 (12:36 +0100)]
lintcheck: make download path and source path consts, move source directory from traget/lintcheck/crates to target/lintcheck/sources
also update logfile with the dtolnay crates
Matthias Krüger [Sun, 28 Feb 2021 01:07:01 +0000 (02:07 +0100)]
lintcheck: more fixes
fix a couple of issues when checking if lintcheck needed rerun after clippy binary changed.
I was apparently still comparing the times wrongly, but it should be fixed™ now...
I actually looked at the date of the sources.toml and not at the date of the log file!
Also fix progress report counter not advancing in squential mode
Matthias Krüger [Sat, 27 Feb 2021 22:31:32 +0000 (23:31 +0100)]
lintcheck: add a couple of dtolnays crates to the source list
Matthias Krüger [Sat, 27 Feb 2021 11:29:13 +0000 (12:29 +0100)]
lintcheck: put the full paths (target/lintcheck/sources/<crate>...) to the source files of a warning into the lintcheck log
This is more convenient when reviewing new lint warnings that popped up in the logs
Matthias Krüger [Sat, 27 Feb 2021 11:05:27 +0000 (12:05 +0100)]
lintcheck: uses consts for clippy driver and cargo clippy paths
Matthias Krüger [Sat, 27 Feb 2021 00:34:45 +0000 (01:34 +0100)]
lintcheck: don't run clippy in parallel by default
Matthias Krüger [Fri, 26 Feb 2021 23:29:42 +0000 (00:29 +0100)]
lintcheck: refactor: introduce a basic LintcheckConfig struct which holds the job limit and paths to the sources and log files
bors [Sun, 28 Feb 2021 20:57:48 +0000 (20:57 +0000)]
Auto merge of #6787 - matthiaskrgr:lint_msgs, r=llogiq
tests: add test that roughly ensures that our lint messages conform with the diagnostics convention of the rustc dev guide
lint message should not start with uppercase letters
lint messages should not have punctuation at the end of the last line
https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure
The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.
changelog: make sure lint messages conform with the rustc dev guide and add test
Jason Newcomb [Sun, 28 Feb 2021 14:03:21 +0000 (09:03 -0500)]
Fix `manual_map`: do not expand macros in suggestions
Matthias Krüger [Sun, 28 Feb 2021 13:01:03 +0000 (14:01 +0100)]
use different example (C-like) for valid capitalized start of lint message
Matthias Krüger [Fri, 26 Feb 2021 21:02:00 +0000 (22:02 +0100)]
lintcheck: update logs
Matthias Krüger [Fri, 26 Feb 2021 14:49:18 +0000 (15:49 +0100)]
change some lint messages and remove old entries from the ignorelist
Matthias Krüger [Thu, 25 Feb 2021 11:30:51 +0000 (12:30 +0100)]
disable lint_message_convention test inside the rustc test suite
Matthias Krüger [Wed, 24 Feb 2021 13:02:51 +0000 (14:02 +0100)]
update the lint messages and tests
Matthias Krüger [Wed, 24 Feb 2021 12:56:04 +0000 (13:56 +0100)]
fix clippy lint warnings
Matthias Krüger [Wed, 24 Feb 2021 12:50:11 +0000 (13:50 +0100)]
tests: add test that roughly ensures that our lint messages conform with the diagnostics convention of the rustc dev guide
lint message should not start with uppercase letters
lint messages should not have punctuation at the end of the last line
https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure
The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.
changelog: make sure lint messages conform with the rustc dev guide and add test
bors [Sun, 28 Feb 2021 00:49:02 +0000 (00:49 +0000)]
Auto merge of #6802 - camsteffen:dogfood-fix, r=llogiq
Remove workspace and fix dogfood (again)
changelog: none
In response to https://github.com/rust-lang/rust-clippy/pull/6733#issuecomment-
785792060
bors [Sat, 27 Feb 2021 14:44:02 +0000 (14:44 +0000)]
Auto merge of #6812 - Y-Nak:fix-6792, r=matthiaskrgr
Fix ICEs 6792 and 6793
fixes #6792, fixes #6793.
r? `@matthiaskrgr`
Fixes the ICEs by replacing `TyCtxt::type_of` with `TypeckResults::expr_ty`.
changelog: none
Yoshitomo Nakanishi [Sat, 27 Feb 2021 13:46:10 +0000 (22:46 +0900)]
Add test for ICE 6793
Yoshitomo Nakanishi [Sat, 27 Feb 2021 12:52:15 +0000 (21:52 +0900)]
Use TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a type" ICE
Takayuki Maeda [Fri, 26 Feb 2021 08:38:21 +0000 (17:38 +0900)]
remove pub(crate)
Takayuki Maeda [Fri, 26 Feb 2021 08:07:00 +0000 (17:07 +0900)]
export `derefs_to_slice` from methods module
Takayuki Maeda [Fri, 26 Feb 2021 07:21:43 +0000 (16:21 +0900)]
receive iter method name as an argument
Takayuki Maeda [Fri, 26 Feb 2021 06:49:03 +0000 (15:49 +0900)]
remove if_chain
Takayuki Maeda [Thu, 25 Feb 2021 19:11:01 +0000 (04:11 +0900)]
return when the ty doesn't have `len()`
Takayuki Maeda [Thu, 25 Feb 2021 17:18:52 +0000 (02:18 +0900)]
move `lints()` to `iter_count.rs`
Takayuki Maeda [Thu, 25 Feb 2021 16:54:51 +0000 (01:54 +0900)]
lint for `into_iter().count()`
Takayuki Maeda [Thu, 25 Feb 2021 14:07:15 +0000 (23:07 +0900)]
allow clippy::iter_count
Takayuki Maeda [Thu, 25 Feb 2021 14:06:50 +0000 (23:06 +0900)]
new lint: iter_count
bors [Sat, 27 Feb 2021 01:40:05 +0000 (01:40 +0000)]
Auto merge of #6730 - anall:feature/owned_to_owned_methods, r=camsteffen
added new lint `owned_to_owned`
Adding new lint `owned_to_owned`
Creating draft PR to have this looked over.
I think this takes all advice I received into account.
I did have to update the `redundant_clone` test to ignore this lint -- I felt that was the safest action.
closes: #6715
changelog: added new lint `implicit_clone`
Andrea Nall [Fri, 12 Feb 2021 04:27:04 +0000 (04:27 +0000)]
added new lint `implicit_clone`
Jason Newcomb [Fri, 26 Feb 2021 21:27:41 +0000 (16:27 -0500)]
Revert #6796: Downgrade manual_map to nursery
Jason Newcomb [Fri, 26 Feb 2021 16:50:12 +0000 (11:50 -0500)]
Fix `manual_map`: don't lint when partially moved values are used.
Fix `manual_map`: don't lint when `return`, `break`, and `continue` are used.
bors [Fri, 26 Feb 2021 19:30:57 +0000 (19:30 +0000)]
Auto merge of #6800 - matthiaskrgr:lintcheck_stats, r=llogiq
lintcheck: print stats how lint counts change
The stats look like this:
````
Stats:
clippy::manual_map 0 => 10
clippy::missing_panics_doc 54 => 56
clippy::upper_case_acronyms 18 => 4
````
changelog: lintcheck: print stats about changing lint counts in the log
Cameron Steffen [Fri, 26 Feb 2021 18:30:43 +0000 (12:30 -0600)]
Revert "Fix versioncheck test"
This reverts commit
1e7b1ccb2a05f80ae0a580401e7565fb1c0a4917 .
Cameron Steffen [Fri, 26 Feb 2021 18:12:33 +0000 (12:12 -0600)]
Add package arguments to dogfood test
This is necessary after migrating to RUSTC_WORKSPACE_WRAPPER.
Cameron Steffen [Fri, 26 Feb 2021 18:11:47 +0000 (12:11 -0600)]
Revert "Add workspace to manifest"
This reverts commit
9bcb257985d5a16355bdd62998935f16d09b42e2 .
Cameron Steffen [Fri, 26 Feb 2021 18:11:35 +0000 (12:11 -0600)]
Revert "Fix lintcheck by excluding checked crates from workspace"
This reverts commit
aea55d2c6239e42a0a337d610d19061521565615 .
Cameron Steffen [Fri, 26 Feb 2021 18:10:24 +0000 (12:10 -0600)]
Revert "Test workspace at once"
This reverts commit
e355652fec704f307b50d42fb6a08172dc1e08bf .
bors [Fri, 26 Feb 2021 15:28:10 +0000 (15:28 +0000)]
Auto merge of #6796 - dtolnay-contrib:manualmap, r=flip1995
Downgrade manual_map to nursery
I believe #6795 should be considered a blocker for this lint to be considered for enabling by default.
---
changelog: remove manual_map from default list of enabled lints
Matthias Krüger [Fri, 26 Feb 2021 10:18:59 +0000 (11:18 +0100)]
lintcheck: update logs and do minor fixes
Matthias Krüger [Tue, 23 Feb 2021 20:23:36 +0000 (21:23 +0100)]
lintcheck: print stats how lint counts have changed between runs
Matthias Krüger [Tue, 23 Feb 2021 20:27:32 +0000 (21:27 +0100)]
lintcheck: fix bug when getting the config toml path.
In order to check if we need to recheck crates, I was getting the path from clap only
which is None if we don't pass it via cmdline args.
Use the dedicated lintcheck_config_toml() fnuction instead!
David Tolnay [Fri, 26 Feb 2021 04:31:24 +0000 (20:31 -0800)]
Downgrade manual_map to nursery
bors [Thu, 25 Feb 2021 21:16:02 +0000 (21:16 +0000)]
Auto merge of #6601 - mdm:fix-unit-args-false-positive, r=camsteffen
Fix false positive for unit_arg lint
Fixes #6447
To avoid false positives don't complain about unit args when they come from a path expression, e.g. a local variable.
**Note:** This is my first contribution to Clippy, so I might have messed up somewhere. Any feedback is welcome and I'm happy to work out any kinks.
---
changelog: Do not lint unit arguments when they come from a path expression.
Marc Dominik Migge [Thu, 25 Feb 2021 21:03:11 +0000 (22:03 +0100)]
Add original test case from issue
bors [Thu, 25 Feb 2021 15:05:06 +0000 (15:05 +0000)]
Auto merge of #6790 - mgacek8:issue_6748, r=Manishearth
or_fun_call: fix suggestion for `or_insert(vec![])`
fixes #6748
changelog: or_fun_call: fix suggestion for `or_insert(vec![])` on `std::collections::hash_map::Entry` or `std::collections::btree_map::Entry`
Mateusz Gacek [Wed, 24 Feb 2021 20:06:26 +0000 (21:06 +0100)]
or_fun_call: fix suggestion for `or_insert(vec![])`
Applies for `std::collections::hash_map::Entry` and `std::collections::btree_map::Entry`
Example:
Previously, for the following code:
`let _ = hash_map.entry("test".to_owned()).or_insert(vec![]);`
clippy would suggest to use:
`or_insert_with(vec![])`, which causes a compiler error (E0277).
Now clippy suggests:
`or_insert_with(Vec::new)`
bors [Thu, 25 Feb 2021 09:49:12 +0000 (09:49 +0000)]
Auto merge of #6789 - flip1995:rustup, r=flip1995
Rustup
r? `@ghost`
changelog: None
flip1995 [Thu, 25 Feb 2021 09:40:24 +0000 (10:40 +0100)]
Bump nightly version -> 2021-02-25
flip1995 [Thu, 25 Feb 2021 09:40:00 +0000 (10:40 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup
bors [Thu, 25 Feb 2021 09:01:41 +0000 (09:01 +0000)]
Auto merge of #6788 - matthiaskrgr:upper_case_acronyms, r=flip1995
move upper_case_acronyms back to style, but make the default behaviour less aggressive by default (can be unleashed via config option)
Previous discussion in the bi-weekly clippy meeting for reference: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202021-02-23/near/
227458019
Move the `upper_case_acronyms` lint back to the style group.
Only warn on fully-capitalized names by default.
Add add a clippy-config option `upper-case-acronyms-aggressive: true/false` to enabled more aggressive linting on
all substrings that could be capitalized acronyms.
---
changelog: reenable upper_case_acronyms by default but make the more aggressive linting opt-in via config option
Matthias Krüger [Wed, 24 Feb 2021 23:10:06 +0000 (00:10 +0100)]
run cargo dev update_lints
fix sentence / address review comments
bors [Thu, 25 Feb 2021 00:22:39 +0000 (00:22 +0000)]
Auto merge of #6783 - avitex:add-opendns-ident, r=giraffate
Add OpenDNS to `doc-valid-idents`
changelog: This commit adds `"OpenDNS"` to doc-valid-idents to avoid `doc_markdown` false positives.
Matthias Krüger [Wed, 24 Feb 2021 22:41:32 +0000 (23:41 +0100)]
upper_case_acronyms: add io-toml tests and bless previous tests
Matthias Krüger [Wed, 24 Feb 2021 22:20:49 +0000 (23:20 +0100)]
upper_case_acronyms: add optional aggressive mode and relax default
Moves the lint back from pedantic to style group.
The lint default now only warns on names that are completely capitalized, like "WORD"
and only if the name is longer than 2 chars (so that names where each of the letter represents a word are still distinguishable).
For example: FP (false positive) would still be "valid" and not warned about (but EOF would warn).
A "upper_case_acronyms_aggressive: true/false" config option was added that restores the original lint behaviour to warn
on any kind of camel case name that had more than one capital letter following another capital letter.
avitex [Wed, 24 Feb 2021 22:26:11 +0000 (09:26 +1100)]
add test coverage for all `doc-valid-idents`
avitex [Wed, 24 Feb 2021 04:04:00 +0000 (15:04 +1100)]
Add OpenDNS to `doc-valid-idents`
bors [Wed, 24 Feb 2021 14:51:14 +0000 (14:51 +0000)]
Auto merge of #6786 - smoelius:move-conf-rs-back-into-clippy-lints, r=flip1995
Move conf.rs back into clippy_lints
This is an alternative solution to #6785 to fix the CI break caused by #6756.
changelog: none
Marc Dominik Migge [Wed, 24 Feb 2021 12:31:04 +0000 (13:31 +0100)]
Don't lint unit args if expression kind is path
Samuel E. Moelius III [Wed, 24 Feb 2021 11:12:27 +0000 (06:12 -0500)]
Move conf.rs back into clippy_lints
bors [Wed, 24 Feb 2021 09:43:23 +0000 (09:43 +0000)]
Auto merge of #6756 - smoelius:clippy_utils, r=flip1995,obi-obk
Factor out `clippy_utils` crate
As discussed in https://github.com/rust-lang/rust-clippy/pull/6746, this PR factors out `clippy_lints::utils` as its own crate, `clippy_utils` .
This change will allow `clippy_utils` to be used in lints outside of Clippy.
There is no plan to publish this crate on `crates.io` (see https://github.com/rust-lang/rust-clippy/pull/6746#issuecomment-
780747522 ). Dependent crates should obtain it from GitHub.
changelog: Factor out `clippy_utils` so it can be used by external tools (not published)
bors [Wed, 24 Feb 2021 09:31:26 +0000 (09:31 +0000)]
Auto merge of #6782 - ojeda:readme-as-wrapper, r=flip1995
README: Add subsection on running Clippy as a rustc wrapper
This is useful for projects that do not use cargo.
changelog: README: Add subsection on running Clippy as a rustc wrapper
Miguel Ojeda [Tue, 23 Feb 2021 14:54:40 +0000 (15:54 +0100)]
README: Add subsection on running Clippy as a rustc wrapper
This is useful for projects that do not use cargo.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Samuel E. Moelius III [Thu, 18 Feb 2021 17:25:35 +0000 (12:25 -0500)]
Move `declare_clippy_lint` back into clippy_lints
Samuel E. Moelius III [Thu, 18 Feb 2021 11:08:46 +0000 (06:08 -0500)]
Update references in doc directory
Samuel E. Moelius [Thu, 18 Feb 2021 10:41:37 +0000 (05:41 -0500)]
Update clippy_utils/Cargo.toml
Co-authored-by: Philipp Krones <hello@philkrones.com>
Samuel E. Moelius III [Thu, 18 Feb 2021 02:54:15 +0000 (21:54 -0500)]
Typo
Samuel E. Moelius III [Thu, 18 Feb 2021 02:51:21 +0000 (21:51 -0500)]
Remove file accidentally re-added during rebase
Samuel E. Moelius III [Thu, 18 Feb 2021 02:04:38 +0000 (21:04 -0500)]
Update custom_ice_message.stderr
Samuel E. Moelius III [Thu, 18 Feb 2021 01:54:14 +0000 (20:54 -0500)]
Fix update_lints
Samuel E. Moelius III [Wed, 17 Feb 2021 23:53:21 +0000 (18:53 -0500)]
Fix doc test
Samuel E. Moelius III [Wed, 17 Feb 2021 22:05:52 +0000 (17:05 -0500)]
Bump clippy_utils version
Samuel E. Moelius III [Wed, 17 Feb 2021 22:05:32 +0000 (17:05 -0500)]
Fix versioncheck test
Samuel E. Moelius III [Wed, 17 Feb 2021 22:03:29 +0000 (17:03 -0500)]
Fix one import
Samuel E. Moelius III [Wed, 17 Feb 2021 17:30:48 +0000 (12:30 -0500)]
Improve tests
Samuel E. Moelius III [Sat, 13 Feb 2021 23:49:22 +0000 (18:49 -0500)]
Remove unused features
Samuel E. Moelius III [Sat, 13 Feb 2021 23:46:11 +0000 (18:46 -0500)]
Remove unused dependencies
Samuel E. Moelius III [Sat, 13 Feb 2021 14:04:50 +0000 (09:04 -0500)]
Get tests to pass
Samuel E. Moelius III [Thu, 11 Feb 2021 20:03:52 +0000 (15:03 -0500)]
Update clippy_utils/src/lib.rs
Samuel E. Moelius III [Thu, 11 Feb 2021 20:03:28 +0000 (15:03 -0500)]
Update clippy_lints/src/lib.rs
Samuel E. Moelius III [Wed, 17 Feb 2021 17:42:21 +0000 (12:42 -0500)]
Factor out `clippy_utils` crate
bors [Tue, 23 Feb 2021 21:56:25 +0000 (21:56 +0000)]
Auto merge of #6573 - Jarcho:option_match_map, r=llogiq
New lint: option_manual_map
fixes: #6
changelog: Added lint: `match_map`
bors [Tue, 23 Feb 2021 12:05:24 +0000 (12:05 +0000)]
Auto merge of #6781 - matthiaskrgr:lintcheck_fix, r=matthiaskrgr
lintcheck fix build (forgot to pass function parameter) and runtime (…
…don't check metadata of directory if it does not exist)
Accidentally broke lintcheck in my previous commit.
changelog: None
Matthias Krüger [Tue, 23 Feb 2021 11:58:12 +0000 (12:58 +0100)]
lintcheck fix build (forgot to pass function parameter) and runtime (don't check metadata of directory if it does not exist)
bors [Tue, 23 Feb 2021 08:31:28 +0000 (08:31 +0000)]
Auto merge of #6780 - matthiaskrgr:lintcheck2, r=flip1995
lintcheck: fully rerun lintcheck if clippy was rebuilt since last log update
Automatically clean lintchecks shared target dir (will force clippy to recheck sources) if
the clippy binaries are older than the lintcheck logs.
Also updated lintcheck logs in the pr.
changelog: lintcheck: fully rerun lintcheck if clippy was rebuilt since last log update
Matthias Krüger [Mon, 22 Feb 2021 23:40:50 +0000 (00:40 +0100)]
lintcheck: rerun if clippy changed
Automatically clean lintchecks shared target dir (will force clippy to recheck sources) if
the clippy binaries are older than the lintcheck logs.
Also update lintcheck logs