Commit graph

10886 commits

Author SHA1 Message Date
Yusuke Tanaka
d04ea41d1f
Move transmute_int_to_bool to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
f8bc0e249c
Move transmute_ptr_to_ptr to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
7af3458b54
Move transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref_to_ref module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
4c65221188
Move transmute_int_to_char to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
6442d45d3a
Move transmute_ptr_to_ref to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
afc9275928
Move crosspointer_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
ef97764dcc
Move wrong_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
0d7dd00860
Move useless_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
4ac438bfed
Add transmute/utils.rs 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
306545ff96
Create transmute directory 2021-03-02 10:37:30 +01: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
Matthias Krüger
12dc03033f 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!
2021-02-26 10:59:40 +01:00
David Tolnay
8f47a4214e
Downgrade manual_map to nursery 2021-02-25 20:31:24 -08:00
bors
d5223be2e3 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.
2021-02-25 21:16:02 +00:00
Marc Dominik Migge
cbe6eec3e6 Add original test case from issue 2021-02-25 22:03:11 +01:00
bors
5c6cd87b94 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`
2021-02-25 15:05:06 +00:00