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

Merged
merged 92 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
a5a07e5
single_match: Don't lint non-exhaustive matches; support tuples
jubnzv Jan 20, 2022
a0c5087
single_match: Clarify the `don't lint` test case
jubnzv Jan 21, 2022
49ae73b
matches: Simplify code
jubnzv Jan 21, 2022
64f5b36
Update Changelog
flip1995 Jan 14, 2022
5416a71
Merge remote-tracking branch 'origin/master' into 8282-single-match
jubnzv Jan 26, 2022
4aee3b1
matches: Clarify the behavior of exhaustive check
jubnzv Jan 26, 2022
8101587
matches: Improve naming. NFC.
jubnzv Jan 26, 2022
467a0bf
matches: Restore `match_type` logic; add tests for these cases
jubnzv Jan 26, 2022
a8fdf5c
matches: Remove extra comment
jubnzv Jan 26, 2022
bf66aed
Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyup
flip1995 Jan 27, 2022
23fd95a
fix underflow in `check_manual_split_once` lint
pr2502 Jan 8, 2022
515ed80
Update docs for `map_flatten` on `Option`
dswij Jan 25, 2022
fb94992
Auto merge of #8354 - dswij:8345, r=giraffate
bors Jan 28, 2022
8d5d9e0
Auto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate
bors Jan 28, 2022
cc97592
Rename path_to_res to def_path_res
camsteffen Jan 6, 2022
bea09a2
Add path_def_id util
camsteffen Jan 4, 2022
20781f1
Rename qpath_generic_tys
camsteffen Jan 17, 2022
145d7fc
Factor out get_qpath_generics
camsteffen Jan 17, 2022
66a83d3
Factor out some ty param utils
camsteffen Jan 6, 2022
deadc25
Factor out differing_macro_contexts
camsteffen Nov 2, 2021
98c6381
Factor out single_segment_path
camsteffen Jan 6, 2022
3771fe4
Factor out expr_path_res
camsteffen Jan 6, 2022
ece7fa4
Factor out match_any_diagnostic_items
camsteffen Jan 6, 2022
bd583d9
Factor out is_qpath_def_path
camsteffen Jan 6, 2022
b7000b2
Add `default_union_representation` lint
jubnzv Jan 15, 2022
7ceffde
Auto merge of #8289 - jubnzv:unspecified-layout-union, r=camsteffen
bors Jan 29, 2022
4119f60
Create `core::fmt::ArgumentV1` with generics instead of fn pointer
nbdd0121 Oct 17, 2021
bee482b
Change index_refutable_slice to use FxIndexMap
nbdd0121 Jan 8, 2022
e7922f7
Format `if_chain` invocations in clippy_utils
smoelius Jan 29, 2022
66bb726
Don't lint `ptr_arg` for `&mut _` types in trait items
Jarcho Jan 29, 2022
8ccd264
modify code
tamaroning Jan 30, 2022
ba80d45
update testsuite
tamaroning Jan 30, 2022
1a2364e
fix code
tamaroning Jan 30, 2022
df6ef60
update get_unwrap.rs
tamaroning Jan 30, 2022
447ed5c
add attributes
tamaroning Jan 30, 2022
0ed8ca4
Auto merge of #8322 - jubnzv:8282-single-match, r=llogiq
bors Jan 30, 2022
b606d16
Auto merge of #90891 - nbdd0121:format, r=Mark-Simulacrum
bors Jan 31, 2022
5faa7eb
Fix `chars_next_cmp` suggestion not escaped
dswij Jan 31, 2022
7bb69c0
Auto merge of #8369 - Jarcho:ptr_arg_8366, r=flip1995
bors Jan 31, 2022
97e5a70
warn if we find multiple clippy configs
matthiaskrgr Jan 20, 2022
1193abe
multiple configs: add tests
matthiaskrgr Jan 30, 2022
0e1cbc5
fix code
tamaroning Feb 1, 2022
b13704a
update test suites
tamaroning Feb 1, 2022
544ed0b
silence lint in clippy
lcnr Feb 1, 2022
99af4c8
remove `TyS::same_type`
lcnr Jan 25, 2022
c7b7b53
Rollup merge of #93290 - lcnr:same_type, r=jackh726
matthiaskrgr Feb 1, 2022
8ef8745
Minor cleanup on transmute lints
Jarcho Feb 1, 2022
b8c80dd
Auto merge of #8330 - flip1995:changelog, r=llogiq
bors Feb 1, 2022
e4f45c2
Fix ICE in `ptr_arg`
Jarcho Feb 1, 2022
327768c
Auto merge of #8387 - Jarcho:ptr_arg_8386, r=flip1995
bors Feb 1, 2022
cf53710
Auto merge of #8370 - smoelius:master, r=flip1995
bors Feb 1, 2022
f5fd9de
chore
tamaroning Feb 2, 2022
bef92b8
Auto merge of #8382 - tamaroning:suggest_iter_instead_of_into_iter, r…
bors Feb 2, 2022
6987217
Lazily resolve type-alias-impl-trait defining uses
oli-obk Aug 20, 2021
3edfd5e
Remove defaultness from ImplItem.
cjgillot Feb 2, 2022
699ee5e
Auto merge of #8376 - dswij:8373, r=camsteffen
bors Feb 5, 2022
4bae06d
Use source callsite in FormatArgsExpn::inputs_span
Alexendoo Jan 28, 2022
144b4a5
Add `explicit_write` suggestions for `write!`s with format args
Alexendoo Jan 28, 2022
29cc0d8
Auto merge of #8372 - tamaroning:unwrap_used, r=llogiq
bors Feb 5, 2022
68b4498
Auto merge of #8365 - Alexendoo:explicit-write-suggestion, r=camsteffen
bors Feb 5, 2022
3403b3e
Add lint `transumte_undefined_repr`
Jarcho Feb 1, 2022
04dce4a
Support `cargo dev bless` for tests with revisions
Alexendoo Jan 30, 2022
68993b1
Small `transmute_float_to_int` cleanup
Jarcho Feb 6, 2022
093e320
Auto merge of #8398 - Jarcho:unordered_transmute, r=llogiq
bors Feb 6, 2022
aae64e9
ignore test on windows since I don't know why compiletest does not ha…
matthiaskrgr Feb 2, 2022
8dc719c
Auto merge of #8326 - matthiaskrgr:warn_on_multi_configs, r=xFrednet
bors Feb 6, 2022
3d43826
Auto merge of #8305 - camsteffen:util-cleanup, r=flip1995
bors Feb 7, 2022
f7be956
Move `matches.rs` to `mod.rs`
Jarcho Feb 6, 2022
e41a6fc
Split out `match_like_matches_macro`
Jarcho Feb 6, 2022
6454825
Split out `match_same_arms`
Jarcho Feb 6, 2022
f2b6ed7
Split out `redundant_pattern_match`
Jarcho Feb 6, 2022
f23dc16
Split out `single_match`
Jarcho Feb 6, 2022
f3dd909
Split out `match_bool`
Jarcho Feb 6, 2022
2a70439
Split out `overlapping_arms`
Jarcho Feb 6, 2022
dc75695
Split out `match_wild_err_arm`
Jarcho Feb 6, 2022
75923df
Split out `wildcard_enum_match_arm` and `match_wildcard_for_single_va…
Jarcho Feb 6, 2022
bccf06f
Split out `match_as_ref`
Jarcho Feb 6, 2022
1da26c8
Split out `match_single_binding`
Jarcho Feb 6, 2022
fb1093c
Split out `match_ref_pats`
Jarcho Feb 6, 2022
6477923
Split out `infalliable_detructuring_match`
Jarcho Feb 7, 2022
aa3af30
Split out `rest_pat_in_fully_bound_struct`
Jarcho Feb 7, 2022
c65894c
Split out `wild_in_or_pats`
Jarcho Feb 7, 2022
2590701
Auto merge of #8400 - Jarcho:split_matches, r=Manishearth
bors Feb 7, 2022
caeebd6
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
bors Feb 8, 2022
88fd090
Factor out ui_test suite
camsteffen Feb 8, 2022
5044e37
Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakis
JohnTitor Feb 9, 2022
6966a42
Auto merge of #8404 - camsteffen:rm-ui-test, r=flip1995
bors Feb 9, 2022
0775c06
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Feb 10, 2022
49b9f92
Bump nightly version -> 2022-02-10
flip1995 Feb 10, 2022
57b3c4b
Auto merge of #8409 - flip1995:rustup, r=flip1995
bors Feb 10, 2022
78ae132
Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup
flip1995 Feb 10, 2022
04c9842
Clippy: Fix botstrap fallout
flip1995 Feb 10, 2022
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
Prev Previous commit
Next Next commit
update testsuite
  • Loading branch information
tamaroning committed Jan 30, 2022
commit ba80d45b3ccbae00b55bed1b30ef5839f5d6855e
2 changes: 1 addition & 1 deletion tests/ui/get_unwrap.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(unused_mut, clippy::from_iter_instead_of_collect)]
#![deny(clippy::get_unwrap)]
#![deny(clippy::get_unwrap, clippy::unwrap_used)]

use std::collections::BTreeMap;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/get_unwrap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(unused_mut, clippy::from_iter_instead_of_collect)]
#![deny(clippy::get_unwrap)]
#![deny(clippy::get_unwrap, clippy::unwrap_used)]

use std::collections::BTreeMap;
use std::collections::HashMap;
Expand Down
145 changes: 143 additions & 2 deletions tests/ui/get_unwrap.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,221 @@ LL | let _ = boxed_slice.get(1).unwrap();
note: the lint level is defined here
--> $DIR/get_unwrap.rs:3:9
|
LL | #![deny(clippy::get_unwrap)]
LL | #![deny(clippy::get_unwrap, clippy::unwrap_used)]
| ^^^^^^^^^^^^^^^^^^

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:34:17
|
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/get_unwrap.rs:3:29
|
LL | #![deny(clippy::get_unwrap, clippy::unwrap_used)]
| ^^^^^^^^^^^^^^^^^^^
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:35:17
|
LL | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:35:17
|
LL | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:36:17
|
LL | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:36:17
|
LL | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:37:17
|
LL | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:37:17
|
LL | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:38:17
|
LL | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:38:17
|
LL | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:39:17
|
LL | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:39:17
|
LL | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:40:17
|
LL | let _ = false_positive.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:42:21
|
LL | let _: u8 = *boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:42:22
|
LL | let _: u8 = *boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:47:9
|
LL | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:47:10
|
LL | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:48:9
|
LL | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:48:10
|
LL | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:49:9
|
LL | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:49:10
|
LL | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:50:9
|
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:50:10
|
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:52:10
|
LL | *some_hashmap.get_mut(&1).unwrap() = 'b';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:53:10
|
LL | *some_btreemap.get_mut(&1).unwrap() = 'b';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:54:10
|
LL | *false_positive.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:59:17
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:59:17
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:60:17
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: aborting due to 13 previous errors
error: used `unwrap()` on `an Option` value
--> $DIR/get_unwrap.rs:60:17
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message

error: aborting due to 30 previous errors