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

Merged
merged 273 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
3d3cfd3
added new lint `implicit_clone`
anall Feb 12, 2021
7154b23
Auto merge of #6730 - anall:feature/owned_to_owned_methods, r=camsteffen
bors Feb 27, 2021
2b3a731
Add missing diagnostic item Symbols
camsteffen Feb 27, 2021
51617b8
new lint: iter_count
TaKO8Ki Feb 25, 2021
7223ee6
allow clippy::iter_count
TaKO8Ki Feb 25, 2021
204b279
lint for `into_iter().count()`
TaKO8Ki Feb 25, 2021
9958af4
move `lints()` to `iter_count.rs`
TaKO8Ki Feb 25, 2021
cc2b000
return when the ty doesn't have `len()`
TaKO8Ki Feb 25, 2021
8bae279
remove if_chain
TaKO8Ki Feb 26, 2021
77907e6
receive iter method name as an argument
TaKO8Ki Feb 26, 2021
c297174
export `derefs_to_slice` from methods module
TaKO8Ki Feb 26, 2021
6041365
remove pub(crate)
TaKO8Ki Feb 26, 2021
bdeec5d
Use TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a t…
Y-Nak Feb 27, 2021
e51bb0e
Add test for ICE 6793
Y-Nak Feb 27, 2021
6971b0d
Auto merge of #6812 - Y-Nak:fix-6792, r=matthiaskrgr
bors Feb 27, 2021
abd2c7e
Auto merge of #6802 - camsteffen:dogfood-fix, r=llogiq
bors Feb 28, 2021
b119b65
tests: add test that roughly ensures that our lint messages conform w…
matthiaskrgr Feb 24, 2021
5370576
fix clippy lint warnings
matthiaskrgr Feb 24, 2021
8eb2bd1
update the lint messages and tests
matthiaskrgr Feb 24, 2021
e107b65
disable lint_message_convention test inside the rustc test suite
matthiaskrgr Feb 25, 2021
e00b1cc
change some lint messages and remove old entries from the ignorelist
matthiaskrgr Feb 26, 2021
24460f7
lintcheck: update logs
matthiaskrgr Feb 26, 2021
ebc5c8f
use different example (C-like) for valid capitalized start of lint me…
matthiaskrgr Feb 28, 2021
da3a573
Fix false positives on procedural macros of `missing_inline_in_public…
Feb 28, 2021
a3278a1
Fix `manual_map`: do not expand macros in suggestions
Jarcho Feb 28, 2021
ac2f041
Auto merge of #6787 - matthiaskrgr:lint_msgs, r=llogiq
bors Feb 28, 2021
d931d1b
lintcheck: refactor: introduce a basic LintcheckConfig struct which h…
matthiaskrgr Feb 26, 2021
2d9932d
lintcheck: don't run clippy in parallel by default
matthiaskrgr Feb 27, 2021
e338604
lintcheck: uses consts for clippy driver and cargo clippy paths
matthiaskrgr Feb 27, 2021
1b1ed93
lintcheck: put the full paths (target/lintcheck/sources/<crate>...) t…
matthiaskrgr Feb 27, 2021
b9a7a2a
lintcheck: add a couple of dtolnays crates to the source list
matthiaskrgr Feb 27, 2021
70d952e
lintcheck: more fixes
matthiaskrgr Feb 28, 2021
1ebaae8
lintcheck: make download path and source path consts, move source dir…
matthiaskrgr Feb 28, 2021
45d6a77
lintcheck: add more embark crate sources to the sources toml
matthiaskrgr Feb 28, 2021
25f9098
update lintcheck_crates logs and fix typos
matthiaskrgr Feb 28, 2021
5ae1e17
Auto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995
bors Mar 1, 2021
7984e60
Use diagnostic items in into_iter_collections
camsteffen Feb 27, 2021
ada8c72
Add version = "Two" to rustfmt.toml
camsteffen Mar 1, 2021
2c485e3
Don't move `yield` or inline assembly into closure
Jarcho Mar 1, 2021
f21320f
Use diagnostic or language items instead of paths
Jarcho Mar 2, 2021
e50afa4
Auto merge of #6822 - camsteffen:rustfmt, r=llogiq
bors Mar 2, 2021
62ac4bd
create loops dir; arrange manual_flatten lint and utils
nahuakang Feb 7, 2021
408368a
Refactor check_for_loop_arg; rename manual_flatten's lint back to che…
nahuakang Feb 8, 2021
7b0f588
Refactor check_for_loop_over_map_kv to its own module
nahuakang Feb 8, 2021
6e4663d
Refactor check_for_mut_range_bound to its own module
nahuakang Feb 8, 2021
71c9fdf
Refactor check_for_loop_range into its module
nahuakang Feb 8, 2021
71026ca
Refactor check_for_loop_explicit_counter to its own module
nahuakang Feb 8, 2021
1e5e541
Refactor check_for_single_element_loop to its own module
nahuakang Feb 8, 2021
9520cba
Add check_infinite_loop to its own module
nahuakang Feb 9, 2021
453e6b9
Add check_needless_collect to its own module
nahuakang Feb 9, 2021
2c1f676
Add detect_same_item_push to its own module
nahuakang Feb 9, 2021
5b870e1
Move detect_manual_memcpy to its module; split up utils structs
nahuakang Feb 9, 2021
455d047
Refactor never loop to its own module
nahuakang Feb 21, 2021
d0b657c
Refactor while let on iterator lint to its module; rename for loop ex…
nahuakang Feb 21, 2021
287a4f8
Refactor empty loop to its own module
nahuakang Feb 21, 2021
7158c94
Refactor while let loop to its own module
nahuakang Feb 21, 2021
7cfdef6
Move MinifyingSugg into manual_memcpy
nahuakang Feb 21, 2021
ecebfe0
Move check_for_loop_arg back to mod; split into 4 lint files
nahuakang Feb 21, 2021
2229a08
Clean up: Rename some files to be consistent with lint names; import …
nahuakang Feb 21, 2021
845a3a0
Include loops.rs changes from PR#6698
nahuakang Feb 22, 2021
eaf63d6
Unify names of lint entry functions in loops to 'check'
Y-Nak Mar 2, 2021
74bd806
Simplify check_for_loop_arg
Y-Nak Mar 2, 2021
306545f
Create transmute directory
magurotuna Feb 10, 2021
4ac438b
Add transmute/utils.rs
magurotuna Feb 10, 2021
0d7dd00
Move useless_transmute to its own module
magurotuna Feb 10, 2021
ef97764
Move wrong_transmute to its own module
magurotuna Feb 10, 2021
afc9275
Move crosspointer_transmute to its own module
magurotuna Feb 10, 2021
6442d45
Move transmute_ptr_to_ref to its own module
magurotuna Feb 10, 2021
4c65221
Move transmute_int_to_char to its own module
magurotuna Feb 10, 2021
7af3458
Move transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref…
magurotuna Feb 10, 2021
f8bc0e2
Move transmute_ptr_to_ptr to its own module
magurotuna Feb 10, 2021
d04ea41
Move transmute_int_to_bool to its own module
magurotuna Feb 10, 2021
acedc7b
Move transmute_int_to_float to its own module
magurotuna Feb 10, 2021
e7d2393
Move transmute_float_to_int to its own module
magurotuna Feb 10, 2021
c57a826
Move unsound_collection_transmute to its own module
magurotuna Feb 10, 2021
25c221e
Move transmutes_expressible_as_ptr_casts to its own module
magurotuna Feb 10, 2021
89ef26a
Cleanup imports
magurotuna Feb 10, 2021
8a8f7b4
Refactor calls to lint check functions
magurotuna Feb 10, 2021
bf00098
Make check_cast private
magurotuna Feb 10, 2021
3cd6ca0
Auto merge of #6716 - magurotuna:refactor-transmute-mod, r=flip1995
bors Mar 2, 2021
eb04beb
Auto merge of #6791 - TaKO8Ki:iter-count, r=matthiaskrgr
bors Mar 2, 2021
19c886b
Remove "for_loop_arg.rs"
Y-Nak Mar 2, 2021
9e4a064
Move naive_bytecount to pedantic
djc Mar 2, 2021
ece3543
Auto merge of #6801 - Jarcho:manual_match_fix, r=phansch
bors Mar 2, 2021
e3f4855
Allow noop_method_call in clippy ui test
rylev Jan 18, 2021
09c4503
Fix borrow and deref
rylev Feb 16, 2021
43d19f6
Auto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995
bors Mar 3, 2021
5656510
Fix false-positive in `use_self`
daxpedda Mar 3, 2021
03e72d5
Let Cargo track `CLIPPY_ARGS`
Mar 3, 2021
ff51964
Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
bors Mar 3, 2021
bbe6416
lintcheck: fix clippy warnings
matthiaskrgr Mar 2, 2021
d783e3d
Auto merge of #6839 - matthiaskrgr:lintcheck_clippy_warnings, r=flip1995
bors Mar 4, 2021
39c5e86
When checking if two empty hir blocks are equal also check to see if …
Jarcho Mar 4, 2021
6680710
Auto merge of #6833 - daxpedda:use-self, r=Manishearth
bors Mar 4, 2021
7be3a32
Auto merge of #6843 - Jarcho:match_on_same_arms_macro, r=Manishearth
bors Mar 4, 2021
37c4b11
lintcheck: add test
matthiaskrgr Mar 4, 2021
3f7ad32
update lintcheck logs
matthiaskrgr Mar 4, 2021
f0e6ce8
Auto merge of #6846 - matthiaskrgr:lintcheck_test, r=Manishearth
bors Mar 4, 2021
26265bb
ci: Sync clippy and clippy_bors workflows
flip1995 Mar 5, 2021
5b2e7e9
Shrink the size of Rvalue by 16 bytes
oli-obk Mar 5, 2021
5ebe6d3
Fix dogfood test
flip1995 Mar 5, 2021
3c502ec
Remove hack that forces dogfood to run on nightly
flip1995 Mar 5, 2021
1d71d9a
Fix dogfood errors in clippy_lints
flip1995 Mar 5, 2021
4aaad08
Fix dogfood errors in clippy_dev
flip1995 Mar 5, 2021
74eb448
Extract directory creation into its own function
flip1995 Mar 5, 2021
9e54538
Auto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr
bors Mar 5, 2021
45424c7
lintcheck: add --fix mode which tries to apply lint suggestions to th…
matthiaskrgr Mar 5, 2021
45454f0
Avoid mir in implicit_return
camsteffen Mar 5, 2021
ae8ec07
Avoid mir in missing_errors_doc
camsteffen Mar 5, 2021
5abd8c5
Use typeck_body
camsteffen Mar 5, 2021
54def1e
Auto merge of #6852 - camsteffen:avoid-mir, r=Manishearth
bors Mar 5, 2021
a0b7f9b
useless_format: fix examples in the description
mgacek8 Mar 5, 2021
0941fc0
Make clippy set mir_opt_level using Option
spastorino Mar 4, 2021
6b40d12
Rollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli…
GuillaumeGomez Mar 5, 2021
0153679
Auto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq
bors Mar 5, 2021
13271d3
Auto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r…
bors Mar 6, 2021
e4ffff9
Use `LanguageItems::require`
Jarcho Mar 2, 2021
5945e85
Auto merge of #6823 - Jarcho:diagnostic_items, r=phansch
bors Mar 7, 2021
47145de
`len_without_is_empty` will now consider multiple impl blocks
Jarcho Mar 5, 2021
e451d6e
Auto merge of #6853 - Jarcho:len_without_is_empty_fp, r=Manishearth
bors Mar 7, 2021
3877a41
migrate paths to newly-added diagnostic items
anall Feb 27, 2021
9bdc273
relocate functions from `clippy_lints::types`
anall Mar 7, 2021
d02ca3b
Auto merge of #6807 - anall:feature/use_new_diagnostics, r=Manishearth
bors Mar 8, 2021
06fe44e
Add msrv to contents in adding lints md
giraffate Mar 8, 2021
b27cbda
make is_normalizable more strict
anall Mar 8, 2021
e6c643f
Auto merge of #6864 - giraffate:fix_doc_adding_a_new_lint, r=Manishearth
bors Mar 8, 2021
f3b68d3
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
bors Mar 8, 2021
2d07c33
Rename `ClippyArgsCallbacks` to `RustcCallbacks`
Mar 8, 2021
2d53b6b
Move `test_no_deps_ignores_path_deps_in_workspaces()` out of `dogfood…
Mar 8, 2021
3cd5f44
Don't panic if `CLIPPY_ARGS` is not Unicode
Mar 8, 2021
d0d5232
Auto merge of #6834 - hyd-dev:clippy-args, r=phansch,flip1995,oli-obk
bors Mar 8, 2021
714a826
Create types dir and move old module under it
Y-Nak Feb 11, 2021
df307c0
Move box_vec to its own module
Y-Nak Feb 11, 2021
128f1f5
Move redundant_allocation to its own module
Y-Nak Feb 11, 2021
f110c5e
Move rc_buffer to its own module
Y-Nak Feb 12, 2021
2c2fb39
Move vec_box to its own module
Y-Nak Feb 12, 2021
fbd25e9
Add flags to detect lints are triggered
Y-Nak Feb 12, 2021
b59c879
Move option_option to its own module
Y-Nak Feb 12, 2021
cc3ab1c
Move linked_list to its own module
Y-Nak Feb 12, 2021
53d3ffe
Move borrowed_box to its own module
Y-Nak Feb 12, 2021
2afa7df
Remove unused is_local from borrowed_box
Y-Nak Feb 12, 2021
bb8208d
Import declared lints at the top of the file
Y-Nak Feb 16, 2021
db59c35
Fix some lints in types that fail dogfood
Y-Nak Feb 25, 2021
b207f23
Auto merge of #6725 - Y-Nak:refactor-types-lints, r=flip1995
bors Mar 8, 2021
f2d917e
Don't assume lang items will exist.
Jarcho Mar 8, 2021
c4e2cf9
Opt-in to rustc_private for `rust-analyzer`
DJMcNab Mar 8, 2021
bf98aa6
Fix redundant closure with macros
camsteffen Mar 8, 2021
7e4f5ca
clippy: fix or-pattern in let binding
mark-i-m Mar 8, 2021
8c540dc
Improve the redundant_closure message
camsteffen Mar 8, 2021
2cb5bbf
Auto merge of #6871 - camsteffen:redundant-closure-macro, r=Manishearth
bors Mar 8, 2021
f098007
Separate lints of casts group from types group
Y-Nak Mar 9, 2021
360f065
Move 'is_isize_or_usize' to clippy_utils
Y-Nak Mar 9, 2021
c2cbcd3
Move cast_precision_loss to its own module
Y-Nak Mar 9, 2021
b12d751
Move cast_lossless to its own module
Y-Nak Mar 9, 2021
e322c77
use TyS::walk
anall Mar 9, 2021
e812a8a
use `.all` instead of negative use of `.any`
anall Mar 9, 2021
727e5f1
Auto merge of #6869 - DJMcNab:rust-analyzer-private, r=phansch
bors Mar 9, 2021
0534bf4
Move cast_possible_truncation to its own module
Y-Nak Mar 9, 2021
0975031
Move cast_sign_loss to its own module
Y-Nak Mar 9, 2021
a383e03
Move cast_possible_wrap to its own module
Y-Nak Mar 9, 2021
9709993
Move unnecessary_cast to its own module
Y-Nak Mar 9, 2021
0dce992
Remove 'lint_numeric_casts'
Y-Nak Mar 9, 2021
458f6d1
Move fn_to_numeric_cast to its own module
Y-Nak Mar 9, 2021
9a24877
Move fn_to_numeric_cast_with_truncation to its own module
Y-Nak Mar 9, 2021
ebd1ec0
Move cast_ptr_alignment to its own module
Y-Nak Mar 9, 2021
f33bb3d
Move cast_ref_to_mut to its own module
Y-Nak Mar 9, 2021
43c88c6
Move char_lit_as_u8 to its own module
Y-Nak Mar 9, 2021
824662d
Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov
m-ou-se Mar 9, 2021
9e631da
Move ptr_as_ptr to its own module
Y-Nak Mar 9, 2021
3ed0bcc
Auto merge of #6873 - Y-Nak:refactor-casts-lint, r=flip1995
bors Mar 9, 2021
627e910
Auto merge of #6868 - Jarcho:lang_item, r=flip1995
bors Mar 9, 2021
9707599
add comment for when can be removed
anall Mar 9, 2021
8a5f98a
Auto merge of #6866 - anall:ice6840, r=flip1995
bors Mar 9, 2021
e0f982b
Improve doc on `map_flatten`
giraffate Mar 9, 2021
2b781c9
Auto merge of #6876 - giraffate:improve_doc_on_map_flatten, r=flip1995
bors Mar 9, 2021
8e1ce48
Set Clippy authors to "The Rust Clippy Developers"
flip1995 Mar 9, 2021
6f60dd8
Update match branches
JulianKnodt Oct 5, 2020
fb4dc58
Update cranelift
JulianKnodt Dec 29, 2020
cb8bc0b
Switch to changing cp_non_overlap in tform
JulianKnodt Jan 23, 2021
8d5e0f5
Simplify clippy author.
cjgillot Dec 6, 2020
476c528
Do not store attrs in FnKind.
cjgillot Nov 27, 2020
3e721b1
Remove hir::StmtKind::attrs.
cjgillot Nov 25, 2020
acd6014
Remove hir::Local::attrs.
cjgillot Nov 25, 2020
b32cffe
Remove hir::Crate::attrs.
cjgillot Nov 26, 2020
0449607
Remove hir::Arm::attrs.
cjgillot Nov 26, 2020
55f68ea
Remove hir::Variant::attrs.
cjgillot Nov 26, 2020
c3a17db
Remove hir::StructField::attrs.
cjgillot Nov 26, 2020
dd2af14
Remove hir::TraitItem::attrs.
cjgillot Nov 27, 2020
49835d8
Remove hir::ImplItem::attrs.
cjgillot Nov 27, 2020
dc9560c
Remove hir::Item::attrs.
cjgillot Jan 24, 2021
6c66826
Remove hir::Expr::attrs.
cjgillot Nov 27, 2020
fb27517
Auto merge of #6878 - flip1995:authors, r=Manishearth
bors Mar 9, 2021
36a27ec
Auto merge of #79519 - cjgillot:noattr, r=wesleywiser
bors Mar 10, 2021
a1e25a9
Auto merge of #6794 - camsteffen:needless-borrowed-ref, r=flip1995
bors Mar 10, 2021
8222d48
Auto merge of #6814 - hyd-dev:issue-6486, r=flip1995
bors Mar 10, 2021
78c740e
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Mar 11, 2021
ae6be4f
Bump nightly version => 2021-03-11
flip1995 Mar 11, 2021
9c1dd0c
Fix remaining dogfood errors (internal lints)
flip1995 Mar 11, 2021
99afc6e
Auto merge of #6881 - flip1995:rustup, r=flip1995
bors Mar 11, 2021
f0f07ac
move expect_used, filter_next, get_unwrap, ok_expect and unwrap_used …
TaKO8Ki Mar 2, 2021
483bac2
move skip_while_next to its own module
TaKO8Ki Mar 2, 2021
110dac7
move option_as_ref_deref to its own module
TaKO8Ki Mar 2, 2021
60a0537
move suspicious_map to its own module
TaKO8Ki Mar 2, 2021
8623b33
move filetype_is_file to its own module
TaKO8Ki Mar 2, 2021
35147d4
move uninit_assumed_init to its own module
TaKO8Ki Mar 2, 2021
45ee914
move iter_cloned_collect to its own module
TaKO8Ki Mar 2, 2021
6376da7
replace `lints` and `lint` with `check`
TaKO8Ki Mar 2, 2021
9b0a42b
move zst_offset to its own module
TaKO8Ki Mar 4, 2021
db91d9c
move map_collect_result_unit to its own module
TaKO8Ki Mar 4, 2021
3fe099b
move iter_next_slice to its own module
TaKO8Ki Mar 4, 2021
5912ca9
move iter_nth, iter_nth_zero and iterator_step_by_zero to their own m…
TaKO8Ki Mar 4, 2021
b5d809a
move wrong_self_convention to its own module
TaKO8Ki Mar 4, 2021
2ade32d
move string_extend_chars and clone_on_ref_ptr to their own module
TaKO8Ki Mar 4, 2021
8006dab
move single_char_insert_string to its own module
TaKO8Ki Mar 6, 2021
805aa47
move single_char_push_string to its own module
TaKO8Ki Mar 6, 2021
0c8d143
move into_iter_on_ref and single_char_pattern to their own modules
TaKO8Ki Mar 6, 2021
2561b7e
move from_iter_insteam_of_collect to its own module
TaKO8Ki Mar 6, 2021
183daeb
move filter_map to its own module
TaKO8Ki Mar 6, 2021
805dcd1
move filter_map_map to its own module
TaKO8Ki Mar 6, 2021
2baf043
move filter_map_next to its own module
TaKO8Ki Mar 6, 2021
6d94161
move filter_flat_map to its own module
TaKO8Ki Mar 6, 2021
f430384
move filter_map_flat_map to its own module
TaKO8Ki Mar 6, 2021
37ba779
move flat_map_identity to its own module
TaKO8Ki Mar 6, 2021
24909fa
move map_flatten and search_is_some to their own modules
TaKO8Ki Mar 6, 2021
171c4c1
move iter_skip_next to its own module
TaKO8Ki Mar 6, 2021
caaba82
move clone_on_copy to its own module
TaKO8Ki Mar 6, 2021
78e572c
move useless_asref to its own module
TaKO8Ki Mar 6, 2021
bbed852
unnecessary_fold to its own module
TaKO8Ki Mar 6, 2021
5557596
move option_map_or_none to its own module
TaKO8Ki Mar 6, 2021
b0824bf
move map_unwrap_or to its own module
TaKO8Ki Mar 6, 2021
f49349b
move or_fun_call to its own module
TaKO8Ki Mar 6, 2021
c711de2
move expect_fun_call to its own module
TaKO8Ki Mar 6, 2021
99f8607
remove unused imports
TaKO8Ki Mar 11, 2021
83a9553
fix interning-defined-symbol error
TaKO8Ki Mar 11, 2021
2546e6f
lintcheck: move out of clippy-dev into own crate
matthiaskrgr Mar 6, 2021
a846945
lintcheck: make sure we lauch from the repo root
matthiaskrgr Mar 9, 2021
c760150
gitignore: add lintchecks target dir
matthiaskrgr Mar 9, 2021
fac6da1
move testfiles to "lintcheck" and fix more paths
matthiaskrgr Mar 9, 2021
d859a17
lintcheck: update readme and remove the now redundant readme from cli…
matthiaskrgr Mar 9, 2021
3e60ba0
lintcheck: fix bug where lint messages about macros coming from crate…
matthiaskrgr Mar 11, 2021
b29ef18
lintcheck: update logs
matthiaskrgr Mar 11, 2021
b068b74
lintcheck: fix --fix and document it in the readme.
matthiaskrgr Mar 11, 2021
528e464
lintcheck: fix clippy warnings
matthiaskrgr Mar 11, 2021
ac93578
docs: basics.md: mention lintcheck
matthiaskrgr Mar 11, 2021
0af90fd
doc line length fixes
matthiaskrgr Mar 11, 2021
534a13d
Auto merge of #6884 - matthiaskrgr:lintcheck_crate, r=Manishearth
bors Mar 11, 2021
6ed6f1e
Auto merge of #6826 - TaKO8Ki:refactor-methods-mod, r=phansch
bors Mar 11, 2021
fb311e1
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
flip1995 Mar 12, 2021
412ebc3
Update Cargo.lock
flip1995 Mar 12, 2021
99d0519
Clippy: HACK! Fix bootstrap error
flip1995 Mar 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ dependencies = [
"clippy_lints",
"compiletest_rs 0.6.0",
"derive-new",
"regex",
"rustc-workspace-hack",
"rustc_tools_util 0.2.0",
"semver 0.11.0",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[alias]
uitest = "test --test compile-test"
dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
dev-lintcheck = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features lintcheck -- lintcheck"
lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "

[build]
rustflags = ["-Zunstable-options"]
18 changes: 14 additions & 4 deletions src/tools/clippy/.github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:

jobs:
base:
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
runs-on: ubuntu-latest

steps:
Expand All @@ -50,11 +51,16 @@ jobs:
- name: Build
run: cargo build --features deny-warnings,internal-lints

- name: Test "--fix -Zunstable-options"
run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options
- name: Test
run: cargo test --features deny-warnings,internal-lints

- name: Test Workspace
run: cargo test --all --features deny-warnings,internal-lints
- name: Test clippy_lints
run: cargo test --features deny-warnings,internal-lints
working-directory: clippy_lints

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
Expand All @@ -64,6 +70,10 @@ jobs:
run: ../target/debug/cargo-clippy
working-directory: clippy_workspace_tests

- name: Test cargo-clippy --fix
run: ../target/debug/cargo-clippy clippy --fix -Zunstable-options
working-directory: clippy_workspace_tests

- name: Test clippy-driver
run: bash .github/driver.sh
env:
Expand Down
24 changes: 22 additions & 2 deletions src/tools/clippy/.github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:

runs-on: ${{ matrix.os }}

# NOTE: If you modify this job, make sure you copy the changes to clippy.yml
steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
Expand Down Expand Up @@ -112,8 +113,16 @@ jobs:
- name: Build
run: cargo build --features deny-warnings,internal-lints

- name: Test Workspace
run: cargo test --all --features deny-warnings,internal-lints
- name: Test
run: cargo test --features deny-warnings,internal-lints

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal-lints
working-directory: clippy_lints

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
Expand All @@ -123,11 +132,22 @@ jobs:
run: ../target/debug/cargo-clippy
working-directory: clippy_workspace_tests

- name: Test cargo-clippy --fix
run: ../target/debug/cargo-clippy clippy --fix -Zunstable-options
working-directory: clippy_workspace_tests

- name: Test clippy-driver
run: bash .github/driver.sh
env:
OS: ${{ runner.os }}

- name: Test cargo dev new lint
run: |
cargo dev new_lint --name new_early_pass --pass early
cargo dev new_lint --name new_late_pass --pass late
cargo check
git reset --hard HEAD

integration_build:
needs: changelog
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ out
/clippy_utils/target
/clippy_workspace_tests/target
/clippy_dev/target
/lintcheck/target
/rustc_tools_util/target

# Generated by dogfood
Expand Down
2 changes: 2 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,7 @@ Released 2018-09-13
[`if_not_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
[`if_same_then_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
[`implicit_hasher`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher
[`implicit_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
Expand Down Expand Up @@ -2134,6 +2135,7 @@ Released 2018-09-13
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
[`iter_cloned_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect
[`iter_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
[`iter_next_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_loop
[`iter_next_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
[`iter_nth`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth
Expand Down
13 changes: 6 additions & 7 deletions src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[package]
name = "clippy"
version = "0.1.52"
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",
"Andre Bogus <bogusandre@gmail.com>",
"Georg Brandl <georg@python.org>",
"Martin Carton <cartonmartin@gmail.com>",
"Oliver Schneider <clippy-iethah7aipeen8neex1a@oli-obk.de>"
]
authors = ["The Rust Clippy Developers"]
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down Expand Up @@ -42,6 +36,7 @@ tester = "0.9"
clippy-mini-macro-test = { version = "0.2", path = "mini-macro" }
serde = { version = "1.0", features = ["derive"] }
derive-new = "0.5"
regex = "1.4"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
Expand All @@ -55,3 +50,7 @@ rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
deny-warnings = []
integration = ["tempfile"]
internal-lints = ["clippy_lints/internal-lints"]

[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
rustc_private = true
1 change: 0 additions & 1 deletion src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ the lint(s) you are interested in:
```terminal
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
```
Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.

### Specifying the minimum supported Rust version

Expand Down
12 changes: 1 addition & 11 deletions src/tools/clippy/clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
[package]
name = "clippy_dev"
version = "0.0.1"
authors = ["Philipp Hansch <dev@phansch.net>"]
authors = ["The Rust Clippy Developers"]
edition = "2018"


[dependencies]
bytecount = "0.6"
clap = "2.33"
flate2 = { version = "1.0.19", optional = true }
fs_extra = { version = "1.2.0", optional = true }
itertools = "0.9"
opener = "0.4"
regex = "1"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
shell-escape = "0.1"
tar = { version = "0.4.30", optional = true }
toml = { version = "0.5", optional = true }
ureq = { version = "2.0.0-rc3", optional = true }
rayon = { version = "1.5.0", optional = true }
walkdir = "2"

[features]
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra", "rayon"]
deny-warnings = []
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_dev/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub fn run(check: bool, verbose: bool) {
success &= cargo_fmt(context, project_root.as_path())?;
success &= cargo_fmt(context, &project_root.join("clippy_dev"))?;
success &= cargo_fmt(context, &project_root.join("rustc_tools_util"))?;
success &= cargo_fmt(context, &project_root.join("lintcheck"))?;

for entry in WalkDir::new(project_root.join("tests")) {
let entry = entry?;
Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use walkdir::WalkDir;

pub mod bless;
pub mod fmt;
pub mod lintcheck;
pub mod new_lint;
pub mod ra_setup;
pub mod serve;
Expand Down Expand Up @@ -530,7 +529,7 @@ fn test_gen_deprecated() {
#[should_panic]
fn test_gen_deprecated_fail() {
let lints = vec![Lint::new("should_assert_eq2", "group2", "abc", None, "module_name")];
let _ = gen_deprecated(lints.iter());
let _deprecated_lints = gen_deprecated(lints.iter());
}

#[test]
Expand Down
44 changes: 3 additions & 41 deletions src/tools/clippy/clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@

use clap::{App, Arg, ArgMatches, SubCommand};
use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints};

#[cfg(feature = "lintcheck")]
use clippy_dev::lintcheck;

fn main() {
let matches = get_clap_config();

match matches.subcommand() {
("bless", Some(matches)) => {
bless::bless(matches.is_present("ignore-timestamp"));
},
#[cfg(feature = "lintcheck")]
("lintcheck", Some(matches)) => {
lintcheck::run(&matches);
},
("fmt", Some(matches)) => {
fmt::run(matches.is_present("check"), matches.is_present("verbose"));
},
Expand Down Expand Up @@ -53,33 +45,7 @@ fn main() {
}

fn get_clap_config<'a>() -> ArgMatches<'a> {
#[cfg(feature = "lintcheck")]
let lintcheck_sbcmd = SubCommand::with_name("lintcheck")
.about("run clippy on a set of crates and check output")
.arg(
Arg::with_name("only")
.takes_value(true)
.value_name("CRATE")
.long("only")
.help("only process a single crate of the list"),
)
.arg(
Arg::with_name("crates-toml")
.takes_value(true)
.value_name("CRATES-SOURCES-TOML-PATH")
.long("crates-toml")
.help("set the path for a crates.toml where lintcheck should read the sources from"),
)
.arg(
Arg::with_name("threads")
.takes_value(true)
.value_name("N")
.short("j")
.long("jobs")
.help("number of threads to use, 0 automatic choice"),
);

let app = App::new("Clippy developer tooling")
App::new("Clippy developer tooling")
.subcommand(
SubCommand::with_name("bless")
.about("bless the test output changes")
Expand Down Expand Up @@ -196,10 +162,6 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
.validator_os(serve::validate_port),
)
.arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")),
);

#[cfg(feature = "lintcheck")]
let app = app.subcommand(lintcheck_sbcmd);

app.get_matches()
)
.get_matches()
}
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dummy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_dummy" # rename to clippy before publishing
version = "0.0.303"
authors = ["Manish Goregaokar <manishsmail@gmail.com>"]
authors = ["The Rust Clippy Developers"]
edition = "2018"
readme = "crates-readme.md"
description = "A bunch of helpful lints to avoid common pitfalls in Rust."
Expand Down
15 changes: 7 additions & 8 deletions src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ name = "clippy_lints"
# begin automatic update
version = "0.1.52"
# end automatic update
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",
"Andre Bogus <bogusandre@gmail.com>",
"Georg Brandl <georg@python.org>",
"Martin Carton <cartonmartin@gmail.com>"
]
authors = ["The Rust Clippy Developers"]
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand All @@ -29,14 +24,18 @@ smallvec = { version = "1", features = ["union"] }
toml = "0.5.3"
unicode-normalization = "0.1"
semver = "0.11"
rustc-semver="1.1.0"
rustc-semver = "1.1.0"
# NOTE: cargo requires serde feat in its url dep
# see <https://github.com/rust-lang/rust/pull/63587#issuecomment-522343864>
url = { version = "2.1.0", features = ["serde"] }
url = { version = "2.1.0", features = ["serde"] }
quote = "1"
syn = { version = "1", features = ["full"] }

[features]
deny-warnings = []
# build clippy with internal lints enabled, off by default
internal-lints = ["clippy_utils/internal-lints"]

[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
rustc_private = true
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/assign_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn lint_misrefactored_assign_op(
diag.span_suggestion(
expr.span,
&format!(
"Did you mean `{} = {} {} {}` or `{}`? Consider replacing it with",
"did you mean `{} = {} {} {}` or `{}`? Consider replacing it with",
snip_a,
snip_a,
op.node.as_str(),
Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/clippy_lints/src/async_yields_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync {
let body_id = BodyId {
hir_id: body.value.hir_id,
};
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
let typeck_results = cx.tcx.typeck(def_id);
let typeck_results = cx.tcx.typeck_body(body_id);
let expr_ty = typeck_results.expr_ty(&body.value);

if implements_trait(cx, expr_ty, future_trait_def_id, &[]) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ fn check_mismatched_target_os(cx: &EarlyContext<'_>, attr: &Attribute) {
diag.span_suggestion(span, "try", sugg, Applicability::MaybeIncorrect);

if !unix_suggested && is_unix(os) {
diag.help("Did you mean `unix`?");
diag.help("did you mean `unix`?");
unix_suggested = true;
}
}
Expand Down
Loading