Skip to content

Commit ede7a3f

Browse files
authored
Merge branch 'master' into patch-1
2 parents 7f330da + 237fbdd commit ede7a3f

File tree

313 files changed

+7460
-2190
lines changed

Some content is hidden

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

313 files changed

+7460
-2190
lines changed

.github/driver.sh

100644100755
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ if [[ ${OS} == "Windows" ]]; then
1111
else
1212
desired_sysroot=/tmp
1313
fi
14+
# Set --sysroot in command line
1415
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
1516
test "$sysroot" = $desired_sysroot
1617

18+
# Set --sysroot in arg_file.txt and pass @arg_file.txt to command line
19+
echo "--sysroot=$desired_sysroot" > arg_file.txt
20+
sysroot=$(./target/debug/clippy-driver @arg_file.txt --print sysroot)
21+
test "$sysroot" = $desired_sysroot
22+
23+
# Setting SYSROOT in command line
1724
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
1825
test "$sysroot" = $desired_sysroot
1926

@@ -24,6 +31,14 @@ test "$sysroot" = $desired_sysroot
2431
SYSROOT=/tmp RUSTFLAGS="--sysroot=$(rustc --print sysroot)" ../target/debug/cargo-clippy clippy --verbose
2532
)
2633

34+
# Check that the --sysroot argument is only passed once via arg_file.txt (SYSROOT is ignored)
35+
(
36+
echo "fn main() {}" > target/driver_test.rs
37+
echo "--sysroot="$(./target/debug/clippy-driver --print sysroot)"" > arg_file.txt
38+
echo "--verbose" >> arg_file.txt
39+
SYSROOT=/tmp ./target/debug/clippy-driver @arg_file.txt ./target/driver_test.rs
40+
)
41+
2742
# Make sure this isn't set - clippy-driver should cope without it
2843
unset CARGO_MANIFEST_DIR
2944

CHANGELOG.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,65 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[09ac14c9...master](https://github.com/rust-lang/rust-clippy/compare/09ac14c9...master)
9+
[a859e5cc...master](https://github.com/rust-lang/rust-clippy/compare/a859e5cc...master)
10+
11+
## Rust 1.76
12+
13+
Current stable, released 2024-02-08
14+
15+
[View all 85 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2023-11-02T20%3A23%3A40Z..2023-12-16T13%3A11%3A08Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
- [`infinite_loop`]
20+
[#11829](https://github.com/rust-lang/rust-clippy/pull/11829)
21+
- [`ineffective_open_options`]
22+
[#11902](https://github.com/rust-lang/rust-clippy/pull/11902)
23+
- [`uninhabited_references`]
24+
[#11878](https://github.com/rust-lang/rust-clippy/pull/11878)
25+
- [`repeat_vec_with_capacity`]
26+
[#11597](https://github.com/rust-lang/rust-clippy/pull/11597)
27+
- [`test_attr_in_doctest`]
28+
[#11872](https://github.com/rust-lang/rust-clippy/pull/11872)
29+
- [`option_map_or_err_ok`]
30+
[#11864](https://github.com/rust-lang/rust-clippy/pull/11864)
31+
- [`join_absolute_paths`]
32+
[#11453](https://github.com/rust-lang/rust-clippy/pull/11453)
33+
- [`impl_hash_borrow_with_str_and_bytes`]
34+
[#11781](https://github.com/rust-lang/rust-clippy/pull/11781)
35+
- [`iter_over_hash_type`]
36+
[#11791](https://github.com/rust-lang/rust-clippy/pull/11791)
37+
38+
### Moves and Deprecations
39+
40+
- Renamed `blocks_in_if_conditions` to [`blocks_in_conditions`]
41+
[#11853](https://github.com/rust-lang/rust-clippy/pull/11853)
42+
- Moved [`implied_bounds_in_impls`] to `complexity` (Now warn-by-default)
43+
[#11867](https://github.com/rust-lang/rust-clippy/pull/11867)
44+
- Moved [`if_same_then_else`] to `style` (Now warn-by-default)
45+
[#11809](https://github.com/rust-lang/rust-clippy/pull/11809)
46+
47+
### Enhancements
48+
49+
- [`missing_safety_doc`], [`unnecessary_safety_doc`], [`missing_panics_doc`], [`missing_errors_doc`]:
50+
Added the [`check-private-items`] configuration to enable lints on private items
51+
[#11842](https://github.com/rust-lang/rust-clippy/pull/11842)
52+
53+
### ICE Fixes
54+
55+
- [`impl_trait_in_params`]: No longer crashes when a function has generics but no function parameters
56+
[#11804](https://github.com/rust-lang/rust-clippy/pull/11804)
57+
- [`unused_enumerate_index`]: No longer crashes on empty tuples
58+
[#11756](https://github.com/rust-lang/rust-clippy/pull/11756)
59+
60+
### Others
61+
62+
- Clippy now respects the `CARGO` environment value
63+
[#11944](https://github.com/rust-lang/rust-clippy/pull/11944)
1064

1165
## Rust 1.75
1266

13-
Current stable, released 2023-12-28
67+
Released 2023-12-28
1468

1569
[View all 69 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2023-09-25T11%3A47%3A47Z..2023-11-02T16%3A41%3A59Z+base%3Amaster)
1670

@@ -5198,6 +5252,7 @@ Released 2018-09-13
51985252
[`implied_bounds_in_impls`]: https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls
51995253
[`impossible_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons
52005254
[`imprecise_flops`]: https://rust-lang.github.io/rust-clippy/master/index.html#imprecise_flops
5255+
[`incompatible_msrv`]: https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
52015256
[`inconsistent_digit_grouping`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_digit_grouping
52025257
[`inconsistent_struct_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor
52035258
[`incorrect_clone_impl_on_copy_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_clone_impl_on_copy_type
@@ -5276,6 +5331,7 @@ Released 2018-09-13
52765331
[`let_with_type_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_with_type_underscore
52775332
[`lines_filter_map_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
52785333
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
5334+
[`lint_groups_priority`]: https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
52795335
[`little_endian_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#little_endian_bytes
52805336
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
52815337
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal
@@ -5284,6 +5340,7 @@ Released 2018-09-13
52845340
[`manual_assert`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
52855341
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
52865342
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
5343+
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
52875344
[`manual_clamp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
52885345
[`manual_filter`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
52895346
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
@@ -5523,6 +5580,7 @@ Released 2018-09-13
55235580
[`redundant_slicing`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing
55245581
[`redundant_static_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
55255582
[`redundant_type_annotations`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_type_annotations
5583+
[`ref_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
55265584
[`ref_binding_to_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_binding_to_reference
55275585
[`ref_in_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_in_deref
55285586
[`ref_option_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
@@ -5606,6 +5664,7 @@ Released 2018-09-13
56065664
[`suspicious_else_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting
56075665
[`suspicious_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map
56085666
[`suspicious_op_assign_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_op_assign_impl
5667+
[`suspicious_open_options`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
56095668
[`suspicious_operation_groupings`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_operation_groupings
56105669
[`suspicious_splitn`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_splitn
56115670
[`suspicious_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned
@@ -5621,6 +5680,7 @@ Released 2018-09-13
56215680
[`to_digit_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_digit_is_some
56225681
[`to_string_in_display`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_display
56235682
[`to_string_in_format_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
5683+
[`to_string_trait_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
56245684
[`todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo
56255685
[`too_many_arguments`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
56265686
[`too_many_lines`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
@@ -5676,6 +5736,7 @@ Released 2018-09-13
56765736
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
56775737
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
56785738
[`unnecessary_owned_empty_strings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings
5739+
[`unnecessary_result_map_or_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_result_map_or_else
56795740
[`unnecessary_safety_comment`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_comment
56805741
[`unnecessary_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
56815742
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
@@ -5814,7 +5875,10 @@ Released 2018-09-13
58145875
[`absolute-paths-max-segments`]: https://doc.rust-lang.org/clippy/lint_configuration.html#absolute-paths-max-segments
58155876
[`absolute-paths-allowed-crates`]: https://doc.rust-lang.org/clippy/lint_configuration.html#absolute-paths-allowed-crates
58165877
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
5878+
[`allowed-duplicate-crates`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-duplicate-crates
58175879
[`enforce-iter-loop-reborrow`]: https://doc.rust-lang.org/clippy/lint_configuration.html#enforce-iter-loop-reborrow
58185880
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
58195881
[`pub-underscore-fields-behavior`]: https://doc.rust-lang.org/clippy/lint_configuration.html#pub-underscore-fields-behavior
5882+
[`allow-comparison-to-zero`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-comparison-to-zero
5883+
[`allowed-wildcard-imports`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-wildcard-imports
58205884
<!-- end autogenerated links to configuration documentation -->

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.77"
3+
version = "0.1.78"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

book/src/lint_configuration.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
151151
* [`manual_try_fold`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold)
152152
* [`manual_hash_one`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_hash_one)
153153
* [`iter_kv_map`](https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map)
154+
* [`manual_c_str_literals`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals)
154155

155156

156157
## `cognitive-complexity-threshold`
@@ -277,7 +278,7 @@ The minimum number of struct fields for the lints about field names to trigger
277278

278279
---
279280
**Affected lints:**
280-
* [`struct_variant_names`](https://rust-lang.github.io/rust-clippy/master/index.html#struct_variant_names)
281+
* [`struct_field_names`](https://rust-lang.github.io/rust-clippy/master/index.html#struct_field_names)
281282

282283

283284
## `enum-variant-size-threshold`
@@ -768,7 +769,19 @@ Additional dotfiles (files or directories starting with a dot) to allow
768769
* [`path_ends_with_ext`](https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext)
769770

770771

772+
## `allowed-duplicate-crates`
773+
A list of crate names to allow duplicates of
774+
775+
**Default Value:** `[]`
776+
777+
---
778+
**Affected lints:**
779+
* [`multiple_crate_versions`](https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions)
780+
781+
771782
## `enforce-iter-loop-reborrow`
783+
Whether to recommend using implicit into iter for reborrowed values.
784+
772785
#### Example
773786
```no_run
774787
let mut vec = vec![1, 2, 3];
@@ -793,7 +806,7 @@ for _ in &mut *rmvec {}
793806

794807

795808
## `check-private-items`
796-
809+
Whether to also run the listed lints on private items.
797810

798811
**Default Value:** `false`
799812

@@ -806,12 +819,45 @@ for _ in &mut *rmvec {}
806819

807820

808821
## `pub-underscore-fields-behavior`
822+
Lint "public" fields in a struct that are prefixed with an underscore based on their
823+
exported visibility, or whether they are marked as "pub".
809824

810-
811-
**Default Value:** `"PublicallyExported"`
825+
**Default Value:** `"PubliclyExported"`
812826

813827
---
814828
**Affected lints:**
815829
* [`pub_underscore_fields`](https://rust-lang.github.io/rust-clippy/master/index.html#pub_underscore_fields)
816830

817831

832+
## `allow-comparison-to-zero`
833+
Don't lint when comparing the result of a modulo operation to zero.
834+
835+
**Default Value:** `true`
836+
837+
---
838+
**Affected lints:**
839+
* [`modulo_arithmetic`](https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic)
840+
841+
842+
## `allowed-wildcard-imports`
843+
List of path segments allowed to have wildcard imports.
844+
845+
#### Example
846+
847+
```toml
848+
allowed-wildcard-imports = [ "utils", "common" ]
849+
```
850+
851+
#### Noteworthy
852+
853+
1. This configuration has no effects if used with `warn_on_all_wildcard_imports = true`.
854+
2. Paths with any segment that containing the word 'prelude'
855+
are already allowed by default.
856+
857+
**Default Value:** `[]`
858+
859+
---
860+
**Affected lints:**
861+
* [`wildcard_imports`](https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports)
862+
863+

clippy.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ avoid-breaking-exported-api = false
22

33
# use the various `span_lint_*` methods instead, which also add a link to the docs
44
disallowed-methods = [
5-
"rustc_lint::context::LintContext::struct_span_lint",
6-
"rustc_middle::ty::context::TyCtxt::struct_span_lint_hir"
5+
"rustc_lint::context::LintContext::span_lint",
6+
"rustc_middle::ty::context::TyCtxt::node_span_lint"
77
]

clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_config"
3-
version = "0.1.77"
3+
version = "0.1.78"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

0 commit comments

Comments
 (0)