Skip to content

Commit e92993d

Browse files
committed
Auto merge of rust-lang#131892 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update One day late with the sync, as I was sick yesterday. Cargo.lock update includes Clippy version bump and some deps cleanup we did in Clippy to match more versions used in the Rust repo. r? `@Manishearth`
2 parents f7b5e54 + cf918d5 commit e92993d

File tree

180 files changed

+4036
-1779
lines changed

Some content is hidden

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

180 files changed

+4036
-1779
lines changed

Cargo.lock

+11-35
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ dependencies = [
377377
"cargo_metadata",
378378
"directories",
379379
"rustc-build-sysroot",
380-
"rustc_tools_util 0.4.0",
380+
"rustc_tools_util",
381381
"rustc_version",
382382
"serde",
383383
"serde_json",
@@ -537,7 +537,7 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
537537

538538
[[package]]
539539
name = "clippy"
540-
version = "0.1.83"
540+
version = "0.1.84"
541541
dependencies = [
542542
"anstream",
543543
"cargo_metadata",
@@ -550,9 +550,11 @@ dependencies = [
550550
"if_chain",
551551
"itertools",
552552
"parking_lot",
553+
"pulldown-cmark 0.11.3",
553554
"quote",
554555
"regex",
555-
"rustc_tools_util 0.3.0",
556+
"rinja",
557+
"rustc_tools_util",
556558
"serde",
557559
"serde_json",
558560
"syn 2.0.79",
@@ -566,7 +568,7 @@ dependencies = [
566568

567569
[[package]]
568570
name = "clippy_config"
569-
version = "0.1.83"
571+
version = "0.1.84"
570572
dependencies = [
571573
"itertools",
572574
"serde",
@@ -582,20 +584,19 @@ dependencies = [
582584
"clap",
583585
"indoc",
584586
"itertools",
585-
"opener 0.6.1",
587+
"opener",
586588
"shell-escape",
587589
"walkdir",
588590
]
589591

590592
[[package]]
591593
name = "clippy_lints"
592-
version = "0.1.83"
594+
version = "0.1.84"
593595
dependencies = [
594596
"arrayvec",
595597
"cargo_metadata",
596598
"clippy_config",
597599
"clippy_utils",
598-
"declare_clippy_lint",
599600
"itertools",
600601
"quine-mc_cluskey",
601602
"regex",
@@ -613,7 +614,7 @@ dependencies = [
613614

614615
[[package]]
615616
name = "clippy_utils"
616-
version = "0.1.83"
617+
version = "0.1.84"
617618
dependencies = [
618619
"arrayvec",
619620
"clippy_config",
@@ -919,15 +920,6 @@ dependencies = [
919920
"winapi",
920921
]
921922

922-
[[package]]
923-
name = "declare_clippy_lint"
924-
version = "0.1.83"
925-
dependencies = [
926-
"itertools",
927-
"quote",
928-
"syn 2.0.79",
929-
]
930-
931923
[[package]]
932924
name = "deranged"
933925
version = "0.3.11"
@@ -2163,7 +2155,7 @@ dependencies = [
21632155
"log",
21642156
"memchr",
21652157
"once_cell",
2166-
"opener 0.7.2",
2158+
"opener",
21672159
"pulldown-cmark 0.10.3",
21682160
"regex",
21692161
"serde",
@@ -2501,17 +2493,6 @@ dependencies = [
25012493
"stable_deref_trait",
25022494
]
25032495

2504-
[[package]]
2505-
name = "opener"
2506-
version = "0.6.1"
2507-
source = "registry+https://github.com/rust-lang/crates.io-index"
2508-
checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788"
2509-
dependencies = [
2510-
"bstr",
2511-
"normpath",
2512-
"winapi",
2513-
]
2514-
25152496
[[package]]
25162497
name = "opener"
25172498
version = "0.7.2"
@@ -2879,6 +2860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
28792860
checksum = "679341d22c78c6c649893cbd6c3278dcbe9fc4faa62fea3a9296ae2b50c14625"
28802861
dependencies = [
28812862
"bitflags 2.6.0",
2863+
"getopts",
28822864
"memchr",
28832865
"pulldown-cmark-escape 0.11.0",
28842866
"unicase",
@@ -4460,12 +4442,6 @@ dependencies = [
44604442
"tracing",
44614443
]
44624444

4463-
[[package]]
4464-
name = "rustc_tools_util"
4465-
version = "0.3.0"
4466-
source = "registry+https://github.com/rust-lang/crates.io-index"
4467-
checksum = "8ba09476327c4b70ccefb6180f046ef588c26a24cf5d269a9feba316eb4f029f"
4468-
44694445
[[package]]
44704446
name = "rustc_tools_util"
44714447
version = "0.4.0"

src/tools/clippy/.github/deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ rm -rf out/master/ || exit 0
88
echo "Making the docs for master"
99
mkdir out/master/
1010
cp util/gh-pages/index.html out/master
11+
cp util/gh-pages/theme.js out/master
1112
cp util/gh-pages/script.js out/master
12-
cp util/gh-pages/lints.json out/master
1313
cp util/gh-pages/style.css out/master
1414

1515
if [[ -n $TAG_NAME ]]; then

src/tools/clippy/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ out
3434

3535
# gh pages docs
3636
util/gh-pages/lints.json
37+
util/gh-pages/index.html
3738

3839
# rustfmt backups
3940
*.rs.bk

src/tools/clippy/CHANGELOG.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,46 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[b794b8e0...master](https://github.com/rust-lang/rust-clippy/compare/b794b8e0...master)
9+
[0f8eabd6...master](https://github.com/rust-lang/rust-clippy/compare/0f8eabd6...master)
10+
11+
## Rust 1.82
12+
13+
Current stable, released 2024-10-17
14+
15+
[View all 108 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-07-11T20%3A12%3A07Z..2024-08-24T20%3A55%3A35Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
* Added [`too_long_first_doc_paragraph`] to `nursery`
20+
[#12993](https://github.com/rust-lang/rust-clippy/pull/12993)
21+
* Added [`unused_result_ok`] to `restriction`
22+
[#12150](https://github.com/rust-lang/rust-clippy/pull/12150)
23+
* Added [`pathbuf_init_then_push`] to `restriction`
24+
[#11700](https://github.com/rust-lang/rust-clippy/pull/11700)
25+
26+
### Enhancements
27+
28+
* [`explicit_iter_loop`]: Now respects the `msrv` configuration
29+
[#13288](https://github.com/rust-lang/rust-clippy/pull/13288)
30+
* [`assigning_clones`]: No longer lints in test code
31+
[#13273](https://github.com/rust-lang/rust-clippy/pull/13273)
32+
* [`inconsistent_struct_constructor`]: Lint attributes now work on the struct definition
33+
[#13211](https://github.com/rust-lang/rust-clippy/pull/13211)
34+
* [`set_contains_or_insert`]: Now also checks for `BTreeSet`
35+
[#13053](https://github.com/rust-lang/rust-clippy/pull/13053)
36+
* [`doc_markdown`]: Added the following identifiers to [`doc-valid-idents`]: AccessKit,
37+
CoreFoundation, CoreGraphics, CoreText, Direct2D, Direct3D, DirectWrite, PostScript,
38+
OpenAL, OpenType, WebRTC, WebSocket, WebTransport, NetBSD, and OpenBSD
39+
[#13093](https://github.com/rust-lang/rust-clippy/pull/13093)
40+
41+
### ICE Fixes
42+
43+
* [`uninit_vec`]
44+
[rust#128720](https://github.com/rust-lang/rust/pull/128720)
1045

1146
## Rust 1.81
1247

13-
Current stable, released 2024-09-05
48+
Released 2024-09-05
1449

1550
### New Lints
1651

@@ -5621,6 +5656,7 @@ Released 2018-09-13
56215656
[`manual_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find_map
56225657
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
56235658
[`manual_hash_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_hash_one
5659+
[`manual_ignore_case_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp
56245660
[`manual_inspect`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
56255661
[`manual_instant_elapsed`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_instant_elapsed
56265662
[`manual_is_ascii_check`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check
@@ -5874,6 +5910,7 @@ Released 2018-09-13
58745910
[`ref_option`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_option
58755911
[`ref_option_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
58765912
[`ref_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_patterns
5913+
[`regex_creation_in_loops`]: https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops
58775914
[`regex_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#regex_macro
58785915
[`renamed_function_params`]: https://rust-lang.github.io/rust-clippy/master/index.html#renamed_function_params
58795916
[`repeat_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#repeat_once
@@ -6027,6 +6064,7 @@ Released 2018-09-13
60276064
[`unnecessary_get_then_check`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
60286065
[`unnecessary_join`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_join
60296066
[`unnecessary_lazy_evaluations`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
6067+
[`unnecessary_literal_bound`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_bound
60306068
[`unnecessary_literal_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
60316069
[`unnecessary_map_on_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_on_constructor
60326070
[`unnecessary_min_or_max`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_min_or_max

src/tools/clippy/Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.83"
3+
version = "0.1.84"
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"
@@ -23,7 +23,7 @@ path = "src/driver.rs"
2323
[dependencies]
2424
clippy_config = { path = "clippy_config" }
2525
clippy_lints = { path = "clippy_lints" }
26-
rustc_tools_util = "0.3.0"
26+
rustc_tools_util = "0.4.0"
2727
tempfile = { version = "3.3", optional = true }
2828
termize = "0.1"
2929
color-print = "0.3.4"
@@ -39,6 +39,8 @@ toml = "0.7.3"
3939
walkdir = "2.3"
4040
filetime = "0.2.9"
4141
itertools = "0.12"
42+
pulldown-cmark = "0.11"
43+
rinja = { version = "0.3", default-features = false, features = ["config"] }
4244

4345
# UI test dependencies
4446
clippy_utils = { path = "clippy_utils" }
@@ -50,7 +52,7 @@ parking_lot = "0.12"
5052
tokio = { version = "1", features = ["io-util"] }
5153

5254
[build-dependencies]
53-
rustc_tools_util = "0.3.0"
55+
rustc_tools_util = "0.4.0"
5456

5557
[features]
5658
integration = ["tempfile"]

src/tools/clippy/book/src/lint_configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ arithmetic-side-effects-allowed-unary = ["SomeType", "AnotherType"]
329329
## `array-size-threshold`
330330
The maximum allowed size for arrays on the stack
331331

332-
**Default Value:** `512000`
332+
**Default Value:** `16384`
333333

334334
---
335335
**Affected lints:**

src/tools/clippy/clippy_config/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_config"
3-
version = "0.1.83"
3+
version = "0.1.84"
44
edition = "2021"
55

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

src/tools/clippy/clippy_config/src/conf.rs

+25-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,30 @@ impl ConfError {
9797
}
9898
}
9999

100+
// Remove code tags and code behind '# 's, as they are not needed for the lint docs and --explain
101+
pub fn sanitize_explanation(raw_docs: &str) -> String {
102+
// Remove tags and hidden code:
103+
let mut explanation = String::with_capacity(128);
104+
let mut in_code = false;
105+
for line in raw_docs.lines().map(str::trim) {
106+
if let Some(lang) = line.strip_prefix("```") {
107+
let tag = lang.split_once(',').map_or(lang, |(left, _)| left);
108+
if !in_code && matches!(tag, "" | "rust" | "ignore" | "should_panic" | "no_run" | "compile_fail") {
109+
explanation += "```rust\n";
110+
} else {
111+
explanation += line;
112+
explanation.push('\n');
113+
}
114+
in_code = !in_code;
115+
} else if !(in_code && line.starts_with("# ")) {
116+
explanation += line;
117+
explanation.push('\n');
118+
}
119+
}
120+
121+
explanation
122+
}
123+
100124
macro_rules! wrap_option {
101125
() => {
102126
None
@@ -366,7 +390,7 @@ define_Conf! {
366390
arithmetic_side_effects_allowed_unary: Vec<String> = <_>::default(),
367391
/// The maximum allowed size for arrays on the stack
368392
#[lints(large_const_arrays, large_stack_arrays)]
369-
array_size_threshold: u64 = 512_000,
393+
array_size_threshold: u64 = 16 * 1024,
370394
/// Suppress lints whenever the suggested change would cause breakage for other crates.
371395
#[lints(
372396
box_collection,

src/tools/clippy/clippy_config/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ mod metadata;
2626
pub mod msrvs;
2727
pub mod types;
2828

29-
pub use conf::{Conf, get_configuration_metadata, lookup_conf_file};
29+
pub use conf::{Conf, get_configuration_metadata, lookup_conf_file, sanitize_explanation};
3030
pub use metadata::ClippyConfiguration;

src/tools/clippy/clippy_config/src/msrvs.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ macro_rules! msrv_aliases {
1717

1818
// names may refer to stabilized feature flags or library items
1919
msrv_aliases! {
20-
1,83,0 { CONST_EXTERN_FN }
21-
1,83,0 { CONST_FLOAT_BITS_CONV }
20+
1,83,0 { CONST_EXTERN_FN, CONST_FLOAT_BITS_CONV, CONST_FLOAT_CLASSIFY }
2221
1,82,0 { IS_NONE_OR }
2322
1,81,0 { LINT_REASONS_STABILIZATION }
2423
1,80,0 { BOX_INTO_ITER}

src/tools/clippy/clippy_dev/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ aho-corasick = "1.0"
99
clap = { version = "4.4", features = ["derive"] }
1010
indoc = "1.0"
1111
itertools = "0.12"
12-
opener = "0.6"
12+
opener = "0.7"
1313
shell-escape = "0.1"
1414
walkdir = "2.3"
1515

0 commit comments

Comments
 (0)