Skip to content

Commit 5b784f8

Browse files
committed
Auto merge of rust-lang#101249 - matthiaskrgr:rollup-wahnoz8, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#100787 (Pretty printing give proper error message without panic) - rust-lang#100838 (Suggest moving redundant generic args of an assoc fn to its trait) - rust-lang#100844 (migrate rustc_query_system to use SessionDiagnostic) - rust-lang#101140 (Update Clippy) - rust-lang#101161 (Fix uintended diagnostic caused by `drain(..)`) - rust-lang#101165 (Use more `into_iter` rather than `drain(..)`) - rust-lang#101229 (Link “? operator” to relevant chapter in The Book) - rust-lang#101230 (lint: avoid linting diag functions with diag lints) - rust-lang#101236 (Avoid needless buffer zeroing in `std::sys::windows::fs`) - rust-lang#101240 (Fix a typo on `wasm64-unknown-unknown` doc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7298de2 + 7bd5b01 commit 5b784f8

File tree

244 files changed

+9254
-3973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+9254
-3973
lines changed

.github/workflows/clippy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ env:
2424
RUST_BACKTRACE: 1
2525
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
2626
NO_FMT_TEST: 1
27+
CARGO_INCREMENTAL: 0
2728

2829
jobs:
2930
base:

.github/workflows/clippy_bors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
RUST_BACKTRACE: 1
1111
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
1212
NO_FMT_TEST: 1
13+
CARGO_INCREMENTAL: 0
1314

1415
defaults:
1516
run:

CHANGELOG.md

+158-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,157 @@ document.
66

77
## Unreleased / In Rust Nightly
88

9-
[7c21f91b...master](https://github.com/rust-lang/rust-clippy/compare/7c21f91b...master)
9+
[d7b5cbf0...master](https://github.com/rust-lang/rust-clippy/compare/d7b5cbf0...master)
10+
11+
## Rust 1.63
12+
13+
Current stable, released 2022-08-11
14+
15+
[7c21f91b...d7b5cbf0](https://github.com/rust-lang/rust-clippy/compare/7c21f91b...d7b5cbf0)
16+
17+
### New Lints
18+
19+
* [`borrow_deref_ref`]
20+
[#7930](https://github.com/rust-lang/rust-clippy/pull/7930)
21+
* [`doc_link_with_quotes`]
22+
[#8385](https://github.com/rust-lang/rust-clippy/pull/8385)
23+
* [`no_effect_replace`]
24+
[#8754](https://github.com/rust-lang/rust-clippy/pull/8754)
25+
* [`rc_clone_in_vec_init`]
26+
[#8769](https://github.com/rust-lang/rust-clippy/pull/8769)
27+
* [`derive_partial_eq_without_eq`]
28+
[#8796](https://github.com/rust-lang/rust-clippy/pull/8796)
29+
* [`mismatching_type_param_order`]
30+
[#8831](https://github.com/rust-lang/rust-clippy/pull/8831)
31+
* [`duplicate_mod`] [#8832](https://github.com/rust-lang/rust-clippy/pull/8832)
32+
* [`unused_rounding`]
33+
[#8866](https://github.com/rust-lang/rust-clippy/pull/8866)
34+
* [`get_first`] [#8882](https://github.com/rust-lang/rust-clippy/pull/8882)
35+
* [`swap_ptr_to_ref`]
36+
[#8916](https://github.com/rust-lang/rust-clippy/pull/8916)
37+
* [`almost_complete_letter_range`]
38+
[#8918](https://github.com/rust-lang/rust-clippy/pull/8918)
39+
* [`needless_parens_on_range_literals`]
40+
[#8933](https://github.com/rust-lang/rust-clippy/pull/8933)
41+
* [`as_underscore`] [#8934](https://github.com/rust-lang/rust-clippy/pull/8934)
42+
43+
### Moves and Deprecations
44+
45+
* Rename `eval_order_dependence` to [`mixed_read_write_in_expression`], move to
46+
`nursery` [#8621](https://github.com/rust-lang/rust-clippy/pull/8621)
47+
48+
### Enhancements
49+
50+
* [`undocumented_unsafe_blocks`]: Now also lints on unsafe trait implementations
51+
[#8761](https://github.com/rust-lang/rust-clippy/pull/8761)
52+
* [`empty_line_after_outer_attr`]: Now also lints on argumentless macros
53+
[#8790](https://github.com/rust-lang/rust-clippy/pull/8790)
54+
* [`expect_used`]: Now can be disabled in tests with the `allow-expect-in-tests`
55+
option [#8802](https://github.com/rust-lang/rust-clippy/pull/8802)
56+
* [`unwrap_used`]: Now can be disabled in tests with the `allow-unwrap-in-tests`
57+
option [#8802](https://github.com/rust-lang/rust-clippy/pull/8802)
58+
* [`disallowed_methods`]: Now also lints indirect usages
59+
[#8852](https://github.com/rust-lang/rust-clippy/pull/8852)
60+
* [`get_last_with_len`]: Now also lints `VecDeque` and any deref to slice
61+
[#8862](https://github.com/rust-lang/rust-clippy/pull/8862)
62+
* [`manual_range_contains`]: Now also lints on chains of `&&` and `||`
63+
[#8884](https://github.com/rust-lang/rust-clippy/pull/8884)
64+
* [`rc_clone_in_vec_init`]: Now also lints on `Weak`
65+
[#8885](https://github.com/rust-lang/rust-clippy/pull/8885)
66+
* [`dbg_macro`]: Introduce `allow-dbg-in-tests` config option
67+
[#8897](https://github.com/rust-lang/rust-clippy/pull/8897)
68+
* [`use_self`]: Now also lints on `TupleStruct` and `Struct` patterns
69+
[#8899](https://github.com/rust-lang/rust-clippy/pull/8899)
70+
* [`manual_find_map`] and [`manual_filter_map`]: Now also lints on more complex
71+
method chains inside `map`
72+
[#8930](https://github.com/rust-lang/rust-clippy/pull/8930)
73+
* [`needless_return`]: Now also lints on macro expressions in return statements
74+
[#8932](https://github.com/rust-lang/rust-clippy/pull/8932)
75+
* [`doc_markdown`]: Users can now indicate, that the `doc-valid-idents` config
76+
should extend the default and not replace it
77+
[#8944](https://github.com/rust-lang/rust-clippy/pull/8944)
78+
* [`disallowed_names`]: Users can now indicate, that the `disallowed-names`
79+
config should extend the default and not replace it
80+
[#8944](https://github.com/rust-lang/rust-clippy/pull/8944)
81+
* [`never_loop`]: Now checks for `continue` in struct expression
82+
[#9002](https://github.com/rust-lang/rust-clippy/pull/9002)
83+
84+
### False Positive Fixes
85+
86+
* [`useless_transmute`]: No longer lints on types with erased regions
87+
[#8564](https://github.com/rust-lang/rust-clippy/pull/8564)
88+
* [`vec_init_then_push`]: No longer lints when further extended
89+
[#8699](https://github.com/rust-lang/rust-clippy/pull/8699)
90+
* [`cmp_owned`]: No longer lints on `From::from` for `Copy` types
91+
[#8807](https://github.com/rust-lang/rust-clippy/pull/8807)
92+
* [`redundant_allocation`]: No longer lints on fat pointers that would become
93+
thin pointers [#8813](https://github.com/rust-lang/rust-clippy/pull/8813)
94+
* [`derive_partial_eq_without_eq`]:
95+
* Handle differing predicates applied by `#[derive(PartialEq)]` and
96+
`#[derive(Eq)]`
97+
[#8869](https://github.com/rust-lang/rust-clippy/pull/8869)
98+
* No longer lints on non-public types and better handles generics
99+
[#8950](https://github.com/rust-lang/rust-clippy/pull/8950)
100+
* [`empty_line_after_outer_attr`]: No longer lints empty lines in inner
101+
string values [#8892](https://github.com/rust-lang/rust-clippy/pull/8892)
102+
* [`branches_sharing_code`]: No longer lints when using different binding names
103+
[#8901](https://github.com/rust-lang/rust-clippy/pull/8901)
104+
* [`significant_drop_in_scrutinee`]: No longer lints on Try `?` and `await`
105+
desugared expressions [#8902](https://github.com/rust-lang/rust-clippy/pull/8902)
106+
* [`checked_conversions`]: No longer lints in `const` contexts
107+
[#8907](https://github.com/rust-lang/rust-clippy/pull/8907)
108+
* [`iter_overeager_cloned`]: No longer lints on `.cloned().flatten()` when
109+
`T::Item` doesn't implement `IntoIterator`
110+
[#8960](https://github.com/rust-lang/rust-clippy/pull/8960)
111+
112+
### Suggestion Fixes/Improvements
113+
114+
* [`vec_init_then_push`]: Suggest to remove `mut` binding when possible
115+
[#8699](https://github.com/rust-lang/rust-clippy/pull/8699)
116+
* [`manual_range_contains`]: Fix suggestion for integers with different signs
117+
[#8763](https://github.com/rust-lang/rust-clippy/pull/8763)
118+
* [`identity_op`]: Add parenthesis to suggestions where required
119+
[#8786](https://github.com/rust-lang/rust-clippy/pull/8786)
120+
* [`cast_lossless`]: No longer gives wrong suggestion on `usize`/`isize`->`f64`
121+
[#8778](https://github.com/rust-lang/rust-clippy/pull/8778)
122+
* [`rc_clone_in_vec_init`]: Add suggestion
123+
[#8814](https://github.com/rust-lang/rust-clippy/pull/8814)
124+
* The "unknown field" error messages for config files now wraps the field names
125+
[#8823](https://github.com/rust-lang/rust-clippy/pull/8823)
126+
* [`cast_abs_to_unsigned`]: Do not remove cast if it's required
127+
[#8876](https://github.com/rust-lang/rust-clippy/pull/8876)
128+
* [`significant_drop_in_scrutinee`]: Improve lint message for types that are not
129+
references and not trivially clone-able
130+
[#8902](https://github.com/rust-lang/rust-clippy/pull/8902)
131+
* [`for_loops_over_fallibles`]: Now suggests the correct variant of `iter()`,
132+
`iter_mut()` or `into_iter()`
133+
[#8941](https://github.com/rust-lang/rust-clippy/pull/8941)
134+
135+
### ICE Fixes
136+
137+
* Fix ICE in [`let_unit_value`] when calling a `static`/`const` callable type
138+
[#8835](https://github.com/rust-lang/rust-clippy/pull/8835)
139+
* Fix ICEs on callable `static`/`const`s
140+
[#8896](https://github.com/rust-lang/rust-clippy/pull/8896)
141+
* [`needless_late_init`]
142+
[#8912](https://github.com/rust-lang/rust-clippy/pull/8912)
143+
* Fix ICE in shadow lints
144+
[#8913](https://github.com/rust-lang/rust-clippy/pull/8913)
145+
146+
### Documentation Improvements
147+
148+
* Clippy has a [Book](https://doc.rust-lang.org/nightly/clippy/) now!
149+
[#7359](https://github.com/rust-lang/rust-clippy/pull/7359)
150+
* Add a *copy lint name*-button to Clippy's lint list
151+
[#8839](https://github.com/rust-lang/rust-clippy/pull/8839)
152+
* Display past names of renamed lints on Clippy's lint list
153+
[#8843](https://github.com/rust-lang/rust-clippy/pull/8843)
154+
* Add the ability to show the lint output in the lint list
155+
[#8947](https://github.com/rust-lang/rust-clippy/pull/8947)
10156

11157
## Rust 1.62
12158

13-
Current stable, released 2022-06-30
159+
Released 2022-06-30
14160

15161
[d0cf3481...7c21f91b](https://github.com/rust-lang/rust-clippy/compare/d0cf3481...7c21f91b)
16162

@@ -3481,6 +3627,7 @@ Released 2018-09-13
34813627
[`cast_ref_to_mut`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_ref_to_mut
34823628
[`cast_sign_loss`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
34833629
[`cast_slice_different_sizes`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_different_sizes
3630+
[`cast_slice_from_raw_parts`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_from_raw_parts
34843631
[`char_lit_as_u8`]: https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
34853632
[`chars_last_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp
34863633
[`chars_next_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp
@@ -3496,6 +3643,7 @@ Released 2018-09-13
34963643
[`collapsible_else_if`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
34973644
[`collapsible_if`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
34983645
[`collapsible_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
3646+
[`collapsible_str_replace`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace
34993647
[`comparison_chain`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
35003648
[`comparison_to_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
35013649
[`const_static_lifetime`]: https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime
@@ -3656,6 +3804,8 @@ Released 2018-09-13
36563804
[`iter_not_returning_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
36573805
[`iter_nth`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth
36583806
[`iter_nth_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
3807+
[`iter_on_empty_collections`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_empty_collections
3808+
[`iter_on_single_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_single_items
36593809
[`iter_overeager_cloned`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned
36603810
[`iter_skip_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
36613811
[`iter_with_drain`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_with_drain
@@ -3697,6 +3847,7 @@ Released 2018-09-13
36973847
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
36983848
[`manual_split_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once
36993849
[`manual_str_repeat`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat
3850+
[`manual_string_new`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
37003851
[`manual_strip`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
37013852
[`manual_swap`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
37023853
[`manual_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
@@ -3747,6 +3898,7 @@ Released 2018-09-13
37473898
[`module_name_repetitions`]: https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
37483899
[`modulo_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
37493900
[`modulo_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#modulo_one
3901+
[`multi_assignments`]: https://rust-lang.github.io/rust-clippy/master/index.html#multi_assignments
37503902
[`multiple_crate_versions`]: https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
37513903
[`multiple_inherent_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
37523904
[`must_use_candidate`]: https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
@@ -3827,6 +3979,7 @@ Released 2018-09-13
38273979
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
38283980
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
38293981
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
3982+
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
38303983
[`possible_missing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_comma
38313984
[`precedence`]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence
38323985
[`print_in_format_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl
@@ -3872,6 +4025,7 @@ Released 2018-09-13
38724025
[`replace_consts`]: https://rust-lang.github.io/rust-clippy/master/index.html#replace_consts
38734026
[`rest_pat_in_fully_bound_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#rest_pat_in_fully_bound_structs
38744027
[`result_expect_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_expect_used
4028+
[`result_large_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
38754029
[`result_map_or_into_option`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_or_into_option
38764030
[`result_map_unit_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_unit_fn
38774031
[`result_map_unwrap_or_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_unwrap_or_else
@@ -3930,6 +4084,7 @@ Released 2018-09-13
39304084
[`suspicious_op_assign_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_op_assign_impl
39314085
[`suspicious_operation_groupings`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_operation_groupings
39324086
[`suspicious_splitn`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_splitn
4087+
[`suspicious_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned
39334088
[`suspicious_unary_op_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_unary_op_formatting
39344089
[`swap_ptr_to_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#swap_ptr_to_ref
39354090
[`tabs_in_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments
@@ -4002,6 +4157,7 @@ Released 2018-09-13
40024157
[`unused_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_collect
40034158
[`unused_io_amount`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
40044159
[`unused_label`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_label
4160+
[`unused_peekable`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable
40054161
[`unused_rounding`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_rounding
40064162
[`unused_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
40074163
[`unused_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit

clippy_dev/src/bless.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn update_reference_file(test_output_entry: &DirEntry, ignore_timestamp: bool) {
3737
return;
3838
}
3939

40-
let test_output_file = fs::read(&test_output_path).expect("Unable to read test output file");
40+
let test_output_file = fs::read(test_output_path).expect("Unable to read test output file");
4141
let reference_file = fs::read(&reference_file_path).unwrap_or_default();
4242

4343
if test_output_file != reference_file {

clippy_dev/src/fmt.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn run(check: bool, verbose: bool) {
4646
// dependency
4747
if fs::read_to_string(project_root.join("Cargo.toml"))
4848
.expect("Failed to read clippy Cargo.toml")
49-
.contains(&"[target.'cfg(NOT_A_PLATFORM)'.dependencies]")
49+
.contains("[target.'cfg(NOT_A_PLATFORM)'.dependencies]")
5050
{
5151
return Err(CliError::IntellijSetupActive);
5252
}
@@ -193,10 +193,10 @@ fn rustfmt_test(context: &FmtContext) -> Result<(), CliError> {
193193
let args = &["--version"];
194194

195195
if context.verbose {
196-
println!("{}", format_command(&program, &dir, args));
196+
println!("{}", format_command(program, &dir, args));
197197
}
198198

199-
let output = Command::new(&program).current_dir(&dir).args(args.iter()).output()?;
199+
let output = Command::new(program).current_dir(&dir).args(args.iter()).output()?;
200200

201201
if output.status.success() {
202202
Ok(())
@@ -207,7 +207,7 @@ fn rustfmt_test(context: &FmtContext) -> Result<(), CliError> {
207207
Err(CliError::RustfmtNotInstalled)
208208
} else {
209209
Err(CliError::CommandFailed(
210-
format_command(&program, &dir, args),
210+
format_command(program, &dir, args),
211211
std::str::from_utf8(&output.stderr).unwrap_or("").to_string(),
212212
))
213213
}

clippy_dev/src/new_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn to_camel_case(name: &str) -> String {
155155
name.split('_')
156156
.map(|s| {
157157
if s.is_empty() {
158-
String::from("")
158+
String::new()
159159
} else {
160160
[&s[0..1].to_uppercase(), &s[1..]].concat()
161161
}

clippy_dev/src/update_lints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
418418
.expect("failed to find `impl_lint_pass` terminator");
419419

420420
impl_lint_pass_end += impl_lint_pass_start;
421-
if let Some(lint_name_pos) = content[impl_lint_pass_start..impl_lint_pass_end].find(&lint_name_upper) {
421+
if let Some(lint_name_pos) = content[impl_lint_pass_start..impl_lint_pass_end].find(lint_name_upper) {
422422
let mut lint_name_end = impl_lint_pass_start + (lint_name_pos + lint_name_upper.len());
423423
for c in content[lint_name_end..impl_lint_pass_end].chars() {
424424
// Remove trailing whitespace
@@ -451,7 +451,7 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
451451
}
452452

453453
let mut content =
454-
fs::read_to_string(&path).unwrap_or_else(|_| panic!("failed to read `{}`", path.to_string_lossy()));
454+
fs::read_to_string(path).unwrap_or_else(|_| panic!("failed to read `{}`", path.to_string_lossy()));
455455

456456
eprintln!(
457457
"warn: you will have to manually remove any code related to `{}` from `{}`",

0 commit comments

Comments
 (0)