Commit Graph

10891 Commits

Author SHA1 Message Date
nahuakang
7158c944a4 Refactor while let loop to its own module 2021-03-02 18:14:20 +09:00
nahuakang
287a4f8ab1 Refactor empty loop to its own module 2021-03-02 18:14:20 +09:00
nahuakang
d0b657c0b7 Refactor while let on iterator lint to its module; rename for loop explicit counter to explicit counter loop 2021-03-02 18:14:20 +09:00
nahuakang
455d0476b1 Refactor never loop to its own module 2021-03-02 18:14:20 +09:00
nahuakang
5b870e1b36 Move detect_manual_memcpy to its module; split up utils structs 2021-03-02 18:14:20 +09:00
nahuakang
2c1f676bfe Add detect_same_item_push to its own module 2021-03-02 18:14:20 +09:00
nahuakang
453e6b97ac Add check_needless_collect to its own module 2021-03-02 18:14:20 +09:00
nahuakang
9520cba554 Add check_infinite_loop to its own module 2021-03-02 18:13:32 +09:00
nahuakang
1e5e541ac5 Refactor check_for_single_element_loop to its own module 2021-03-02 18:13:32 +09:00
nahuakang
71026cad54 Refactor check_for_loop_explicit_counter to its own module 2021-03-02 18:13:32 +09:00
nahuakang
71c9fdf8b1 Refactor check_for_loop_range into its module 2021-03-02 18:13:32 +09:00
nahuakang
6e4663dedf Refactor check_for_mut_range_bound to its own module 2021-03-02 18:13:32 +09:00
nahuakang
7b0f588b77 Refactor check_for_loop_over_map_kv to its own module 2021-03-02 18:13:32 +09:00
nahuakang
408368a82c Refactor check_for_loop_arg; rename manual_flatten's lint back to check_manual_flatten 2021-03-02 18:13:32 +09:00
nahuakang
62ac4bd1b2 create loops dir; arrange manual_flatten lint and utils 2021-03-02 18:13:32 +09:00
bors
e50afa43d0 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. 😃
2021-03-02 08:57:11 +00:00
Cameron Steffen
ada8c72f3f Add version = "Two" to rustfmt.toml
Ignore UI tests since this change makes rustfmt less friendly with UI
test comments.
2021-03-01 16:17:33 -06:00
bors
5ae1e17e81 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
2021-03-01 11:37:08 +00:00
Matthias Krüger
25f909863b update lintcheck_crates logs and fix typos 2021-02-28 23:07:12 +01:00
Matthias Krüger
45d6a77ce8 lintcheck: add more embark crate sources to the sources toml 2021-02-28 23:07:11 +01:00
Matthias Krüger
1ebaae8a15 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
2021-02-28 23:07:09 +01:00
Matthias Krüger
70d952e751 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
2021-02-28 22:59:46 +01:00
Matthias Krüger
b9a7a2a275 lintcheck: add a couple of dtolnays crates to the source list 2021-02-28 22:59:46 +01:00
Matthias Krüger
1b1ed9359e 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
2021-02-28 22:59:45 +01:00
Matthias Krüger
e3386041a2 lintcheck: uses consts for clippy driver and cargo clippy paths 2021-02-28 22:53:52 +01:00
Matthias Krüger
2d9932d720 lintcheck: don't run clippy in parallel by default 2021-02-28 22:53:52 +01:00
Matthias Krüger
d931d1b5e6 lintcheck: refactor: introduce a basic LintcheckConfig struct which holds the job limit and paths to the sources and log files 2021-02-28 22:53:52 +01:00
bors
ac2f041b47 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
2021-02-28 20:57:48 +00:00
Matthias Krüger
ebc5c8f271 use different example (C-like) for valid capitalized start of lint message 2021-02-28 14:01:45 +01:00
Matthias Krüger
24460f76cb lintcheck: update logs 2021-02-28 02:22:05 +01:00
Matthias Krüger
e00b1cc73a change some lint messages and remove old entries from the ignorelist 2021-02-28 02:22:05 +01:00
Matthias Krüger
e107b65b5a disable lint_message_convention test inside the rustc test suite 2021-02-28 02:22:05 +01:00
Matthias Krüger
8eb2bd13d0 update the lint messages and tests 2021-02-28 02:22:05 +01:00
Matthias Krüger
5370576882 fix clippy lint warnings 2021-02-28 02:22:05 +01:00
Matthias Krüger
b119b65859 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
2021-02-28 02:22:05 +01:00
bors
abd2c7ebfb 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
2021-02-28 00:49:02 +00:00
bors
6971b0d199 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
2021-02-27 14:44:02 +00:00
Yoshitomo Nakanishi
e51bb0ee26 Add test for ICE 6793 2021-02-27 22:57:30 +09:00
Yoshitomo Nakanishi
bdeec5dbd6 Use TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a type" ICE 2021-02-27 22:57:29 +09:00
bors
7154b23601 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`
2021-02-27 01:40:05 +00:00
Andrea Nall
3d3cfd3754 added new lint implicit_clone 2021-02-26 19:13:47 -06:00
bors
6343446b89 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
2021-02-26 19:30:57 +00:00
Cameron Steffen
d71ed26fd2 Revert "Fix versioncheck test"
This reverts commit 1e7b1ccb2a.
2021-02-26 12:30:43 -06:00
Cameron Steffen
aef6dc23ee Add package arguments to dogfood test
This is necessary after migrating to RUSTC_WORKSPACE_WRAPPER.
2021-02-26 12:12:33 -06:00
Cameron Steffen
fb905dffb4 Revert "Add workspace to manifest"
This reverts commit 9bcb257985.
2021-02-26 12:11:47 -06:00
Cameron Steffen
814b006d03 Revert "Fix lintcheck by excluding checked crates from workspace"
This reverts commit aea55d2c62.
2021-02-26 12:11:35 -06:00
Cameron Steffen
1368cb34d1 Revert "Test workspace at once"
This reverts commit e355652fec.
2021-02-26 12:10:24 -06:00
bors
186bf1ccb4 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
2021-02-26 15:28:10 +00:00
Matthias Krüger
90cf27e9f6 lintcheck: update logs and do minor fixes 2021-02-26 11:18:59 +01:00
Matthias Krüger
3e1eea6c97 lintcheck: print stats how lint counts have changed between runs 2021-02-26 11:08:42 +01:00