Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a985d8e

Browse files
committed
Auto merge of rust-lang#87579 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
2 parents 5fb3394 + 8570a36 commit a985d8e

File tree

284 files changed

+3439
-3116
lines changed

Some content is hidden

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

284 files changed

+3439
-3116
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ dependencies = [
542542

543543
[[package]]
544544
name = "clippy"
545-
version = "0.1.55"
545+
version = "0.1.56"
546546
dependencies = [
547547
"cargo_metadata 0.12.0",
548548
"clippy_lints",
@@ -575,7 +575,7 @@ dependencies = [
575575

576576
[[package]]
577577
name = "clippy_lints"
578-
version = "0.1.55"
578+
version = "0.1.56"
579579
dependencies = [
580580
"cargo_metadata 0.12.0",
581581
"clippy_utils",
@@ -596,7 +596,7 @@ dependencies = [
596596

597597
[[package]]
598598
name = "clippy_utils"
599-
version = "0.1.55"
599+
version = "0.1.56"
600600
dependencies = [
601601
"if_chain",
602602
"itertools 0.9.0",

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ 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-
python3 ./util/export.py out/master/lints.json
11+
cp util/gh-pages/lints.json out/master
1212

1313
if [[ -n $TAG_NAME ]]; then
1414
echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
15-
cp -r out/master "out/$TAG_NAME"
16-
rm -f out/stable
17-
ln -s "$TAG_NAME" out/stable
15+
cp -Tr out/master "out/$TAG_NAME"
16+
ln -sf "$TAG_NAME" out/stable
1817
fi
1918

2019
if [[ $BETA = "true" ]]; then
@@ -28,8 +27,8 @@ cp util/gh-pages/versions.html out/index.html
2827
echo "Making the versions.json file"
2928
python3 ./util/versions.py out
3029

31-
cd out
3230
# Now let's go have some fun with the cloned repo
31+
cd out
3332
git config user.name "GHA CI"
3433
git config user.email "gha@ci.invalid"
3534

src/tools/clippy/.github/workflows/deploy.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,23 @@ jobs:
3939
if: github.ref == 'refs/heads/beta'
4040
run: echo "BETA=true" >> $GITHUB_ENV
4141

42-
- name: Use scripts and templates from master branch
42+
# We need to check out all files that (transitively) depend on the
43+
# structure of the gh-pages branch, so that we're able to change that
44+
# structure without breaking the deployment.
45+
- name: Use deploy files from master branch
4346
run: |
4447
git fetch --no-tags --prune --depth=1 origin master
45-
git checkout origin/master -- .github/deploy.sh util/gh-pages/ util/*.py
48+
git checkout origin/master -- .github/deploy.sh util/versions.py util/gh-pages/versions.html
49+
50+
# Generate lockfile for caching to avoid build problems with cached deps
51+
- name: cargo generate-lockfile
52+
run: cargo generate-lockfile
53+
54+
- name: Cache
55+
uses: Swatinem/rust-cache@v1.3.0
56+
57+
- name: cargo collect-metadata
58+
run: cargo collect-metadata
4659

4760
- name: Deploy
4861
run: |

src/tools/clippy/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,6 @@ Released 2018-09-13
24232423
<!-- begin autogenerated links to lint list -->
24242424
[`absurd_extreme_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
24252425
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
2426-
[`append_instead_of_extend`]: https://rust-lang.github.io/rust-clippy/master/index.html#append_instead_of_extend
24272426
[`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
24282427
[`as_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
24292428
[`assertions_on_constants`]: https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants
@@ -2522,6 +2521,7 @@ Released 2018-09-13
25222521
[`explicit_iter_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
25232522
[`explicit_write`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_write
25242523
[`extend_from_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#extend_from_slice
2524+
[`extend_with_drain`]: https://rust-lang.github.io/rust-clippy/master/index.html#extend_with_drain
25252525
[`extra_unused_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
25262526
[`fallible_impl_from`]: https://rust-lang.github.io/rust-clippy/master/index.html#fallible_impl_from
25272527
[`field_reassign_with_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
@@ -2772,7 +2772,7 @@ Released 2018-09-13
27722772
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
27732773
[`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
27742774
[`self_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_assignment
2775-
[`self_named_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructor
2775+
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
27762776
[`semicolon_if_nothing_returned`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
27772777
[`serde_api_misuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#serde_api_misuse
27782778
[`shadow_reuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse

src/tools/clippy/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.55"
3+
version = "0.1.56"
44
authors = ["The Rust Clippy Developers"]
55
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
66
repository = "https://github.com/rust-lang/rust-clippy"

src/tools/clippy/clippy_dev/src/new_lint.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,11 @@ use rustc_session::{{declare_lint_pass, declare_tool_lint}};
169169
{pass_import}
170170
171171
declare_clippy_lint! {{
172-
/// **What it does:**
172+
/// ### What it does
173173
///
174-
/// **Why is this bad?**
175-
///
176-
/// **Known problems:** None.
177-
///
178-
/// **Example:**
174+
/// ### Why is this bad?
179175
///
176+
/// ### Example
180177
/// ```rust
181178
/// // example code where clippy issues a warning
182179
/// ```

src/tools/clippy/clippy_dev/src/serve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub fn run(port: u16, lint: Option<&str>) -> ! {
1515

1616
loop {
1717
if mtime("util/gh-pages/lints.json") < mtime("clippy_lints/src") {
18-
Command::new("python3")
19-
.arg("util/export.py")
18+
Command::new("cargo")
19+
.arg("collect-metadata")
2020
.spawn()
2121
.unwrap()
2222
.wait()

src/tools/clippy/clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.1.55"
4+
version = "0.1.56"
55
# end automatic update
66
authors = ["The Rust Clippy Developers"]
77
description = "A bunch of helpful lints to avoid common pitfalls in Rust"

src/tools/clippy/clippy_lints/src/absurd_extreme_comparisons.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ use clippy_utils::ty::is_isize_or_usize;
1111
use clippy_utils::{clip, int_bits, unsext};
1212

1313
declare_clippy_lint! {
14-
/// **What it does:** Checks for comparisons where one side of the relation is
14+
/// ### What it does
15+
/// Checks for comparisons where one side of the relation is
1516
/// either the minimum or maximum value for its type and warns if it involves a
1617
/// case that is always true or always false. Only integer and boolean types are
1718
/// checked.
1819
///
19-
/// **Why is this bad?** An expression like `min <= x` may misleadingly imply
20+
/// ### Why is this bad?
21+
/// An expression like `min <= x` may misleadingly imply
2022
/// that it is possible for `x` to be less than the minimum. Expressions like
2123
/// `max < x` are probably mistakes.
2224
///
23-
/// **Known problems:** For `usize` the size of the current compile target will
25+
/// ### Known problems
26+
/// For `usize` the size of the current compile target will
2427
/// be assumed (e.g., 64 bits on 64 bit systems). This means code that uses such
2528
/// a comparison to detect target pointer width will trigger this lint. One can
2629
/// use `mem::sizeof` and compare its value or conditional compilation
2730
/// attributes
2831
/// like `#[cfg(target_pointer_width = "64")] ..` instead.
2932
///
30-
/// **Example:**
31-
///
33+
/// ### Example
3234
/// ```rust
3335
/// let vec: Vec<isize> = Vec::new();
3436
/// if vec.len() <= 0 {}

src/tools/clippy/clippy_lints/src/approx_const.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ use rustc_span::symbol;
77
use std::f64::consts as f64;
88

99
declare_clippy_lint! {
10-
/// **What it does:** Checks for floating point literals that approximate
10+
/// ### What it does
11+
/// Checks for floating point literals that approximate
1112
/// constants which are defined in
1213
/// [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)
1314
/// or
1415
/// [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),
1516
/// respectively, suggesting to use the predefined constant.
1617
///
17-
/// **Why is this bad?** Usually, the definition in the standard library is more
18+
/// ### Why is this bad?
19+
/// Usually, the definition in the standard library is more
1820
/// precise than what people come up with. If you find that your definition is
1921
/// actually more precise, please [file a Rust
2022
/// issue](https://github.com/rust-lang/rust/issues).
2123
///
22-
/// **Known problems:** None.
23-
///
24-
/// **Example:**
24+
/// ### Example
2525
/// ```rust
2626
/// let x = 3.14;
2727
/// let y = 1_f64 / x;

0 commit comments

Comments
 (0)