Skip to content

Commit 08be39b

Browse files
committed
Merge commit '397aa53a61029ca9df980fe3be8907ac96bb7dbc' into clippy-subtree-update
2 parents 9050733 + 397aa53 commit 08be39b

File tree

109 files changed

+6802
-2219
lines changed

Some content is hidden

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

109 files changed

+6802
-2219
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
# Setup
3636
- name: Checkout
37-
uses: actions/checkout@v5
37+
uses: actions/checkout@v6
3838
with:
3939
persist-credentials: false
4040

@@ -94,7 +94,7 @@ jobs:
9494
steps:
9595
# Setup
9696
- name: Checkout
97-
uses: actions/checkout@v5
97+
uses: actions/checkout@v6
9898
with:
9999
persist-credentials: false
100100

@@ -112,7 +112,7 @@ jobs:
112112
steps:
113113
# Setup
114114
- name: Checkout
115-
uses: actions/checkout@v5
115+
uses: actions/checkout@v6
116116
with:
117117
persist-credentials: false
118118

@@ -168,7 +168,7 @@ jobs:
168168
steps:
169169
# Setup
170170
- name: Checkout
171-
uses: actions/checkout@v5
171+
uses: actions/checkout@v6
172172
with:
173173
persist-credentials: false
174174

@@ -179,7 +179,7 @@ jobs:
179179
180180
# Download
181181
- name: Download target dir
182-
uses: actions/download-artifact@v5
182+
uses: actions/download-artifact@v6
183183
with:
184184
name: binaries
185185
path: target/debug

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
steps:
2626
# Setup
2727
- name: Checkout
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
with:
3030
# Unsetting this would make so that any malicious package could get our Github Token
3131
persist-credentials: false
3232

3333
- name: Checkout
34-
uses: actions/checkout@v5
34+
uses: actions/checkout@v6
3535
with:
3636
ref: ${{ env.TARGET_BRANCH }}
3737
path: 'out'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828
with:
2929
fetch-depth: 2
3030
# Unsetting this would make so that any malicious package could get our Github Token
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Checkout
83-
uses: actions/checkout@v5
83+
uses: actions/checkout@v6
8484
with:
8585
# Unsetting this would make so that any malicious package could get our Github Token
8686
persist-credentials: false
@@ -113,7 +113,7 @@ jobs:
113113

114114
steps:
115115
- name: Checkout
116-
uses: actions/checkout@v5
116+
uses: actions/checkout@v6
117117
with:
118118
# Unsetting this would make so that any malicious package could get our Github Token
119119
persist-credentials: false

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ on:
44
merge_group:
55
pull_request:
66

7+
env:
8+
MDBOOK_VERSION: 0.5.1
9+
710
jobs:
811
remark:
912
runs-on: ubuntu-latest
1013

1114
steps:
1215
# Setup
1316
- name: Checkout
14-
uses: actions/checkout@v5
17+
uses: actions/checkout@v6
1518
with:
1619
# Unsetting this would make so that any malicious package could get our Github Token
1720
persist-credentials: false
@@ -27,7 +30,7 @@ jobs:
2730
- name: Install mdbook
2831
run: |
2932
mkdir mdbook
30-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
33+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
3134
echo `pwd`/mdbook >> $GITHUB_PATH
3235
3336
# Run

src/tools/clippy/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6314,6 +6314,7 @@ Released 2018-09-13
63146314
[`doc_markdown`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
63156315
[`doc_nested_refdefs`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_nested_refdefs
63166316
[`doc_overindented_list_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
6317+
[`doc_paragraphs_missing_punctuation`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_paragraphs_missing_punctuation
63176318
[`doc_suspicious_footnotes`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_suspicious_footnotes
63186319
[`double_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_comparisons
63196320
[`double_ended_iterator_last`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
@@ -7121,6 +7122,7 @@ Released 2018-09-13
71217122
[`future-size-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#future-size-threshold
71227123
[`ignore-interior-mutability`]: https://doc.rust-lang.org/clippy/lint_configuration.html#ignore-interior-mutability
71237124
[`inherent-impl-lint-scope`]: https://doc.rust-lang.org/clippy/lint_configuration.html#inherent-impl-lint-scope
7125+
[`large-error-ignored`]: https://doc.rust-lang.org/clippy/lint_configuration.html#large-error-ignored
71247126
[`large-error-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#large-error-threshold
71257127
[`lint-commented-code`]: https://doc.rust-lang.org/clippy/lint_configuration.html#lint-commented-code
71267128
[`literal-representation-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#literal-representation-threshold

src/tools/clippy/book/src/continuous_integration/github_actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
clippy_check:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1919
- name: Run Clippy
2020
run: cargo clippy --all-targets --all-features
2121
```

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,17 @@ Sets the scope ("crate", "file", or "module") in which duplicate inherent `impl`
681681
* [`multiple_inherent_impl`](https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl)
682682

683683

684+
## `large-error-ignored`
685+
A list of paths to types that should be ignored as overly large `Err`-variants in a
686+
`Result` returned from a function
687+
688+
**Default Value:** `[]`
689+
690+
---
691+
**Affected lints:**
692+
* [`result_large_err`](https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err)
693+
694+
684695
## `large-error-threshold`
685696
The maximum size of the `Err`-variant in a `Result` returned from a function
686697

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ define_Conf! {
666666
/// Sets the scope ("crate", "file", or "module") in which duplicate inherent `impl` blocks for the same type are linted.
667667
#[lints(multiple_inherent_impl)]
668668
inherent_impl_lint_scope: InherentImplLintScope = InherentImplLintScope::Crate,
669+
/// A list of paths to types that should be ignored as overly large `Err`-variants in a
670+
/// `Result` returned from a function
671+
#[lints(result_large_err)]
672+
large_error_ignored: Vec<String> = Vec::default(),
669673
/// The maximum size of the `Err`-variant in a `Result` returned from a function
670674
#[lints(result_large_err)]
671675
large_error_threshold: u64 = 128,

src/tools/clippy/clippy_lints/src/byte_char_slices.rs

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ declare_lint_pass!(ByteCharSlice => [BYTE_CHAR_SLICES]);
3131

3232
impl EarlyLintPass for ByteCharSlice {
3333
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
34-
if let Some(slice) = is_byte_char_slices(expr)
35-
&& !expr.span.from_expansion()
34+
if !expr.span.from_expansion()
35+
&& let Some(slice) = is_byte_char_slices(expr)
3636
{
3737
span_lint_and_sugg(
3838
cx,
@@ -47,33 +47,28 @@ impl EarlyLintPass for ByteCharSlice {
4747
}
4848
}
4949

50+
/// Checks whether the slice is that of byte chars, and if so, builds a byte-string out of it
5051
fn is_byte_char_slices(expr: &Expr) -> Option<String> {
51-
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, expr) = &expr.kind {
52-
match &expr.kind {
53-
ExprKind::Array(members) => {
54-
if members.is_empty() {
55-
return None;
56-
}
57-
58-
members
59-
.iter()
60-
.map(|member| match &member.kind {
61-
ExprKind::Lit(Lit {
62-
kind: LitKind::Byte,
63-
symbol,
64-
..
65-
}) => Some(symbol.as_str()),
66-
_ => None,
67-
})
68-
.map(|maybe_quote| match maybe_quote {
69-
Some("\"") => Some("\\\""),
70-
Some("\\'") => Some("'"),
71-
other => other,
72-
})
73-
.collect::<Option<String>>()
74-
},
75-
_ => None,
76-
}
52+
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, expr) = &expr.kind
53+
&& let ExprKind::Array(members) = &expr.kind
54+
&& !members.is_empty()
55+
{
56+
members
57+
.iter()
58+
.map(|member| match &member.kind {
59+
ExprKind::Lit(Lit {
60+
kind: LitKind::Byte,
61+
symbol,
62+
..
63+
}) => Some(symbol.as_str()),
64+
_ => None,
65+
})
66+
.map(|maybe_quote| match maybe_quote {
67+
Some("\"") => Some("\\\""),
68+
Some("\\'") => Some("'"),
69+
other => other,
70+
})
71+
.collect::<Option<String>>()
7772
} else {
7873
None
7974
}

src/tools/clippy/clippy_lints/src/declared_lints.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
118118
crate::doc::DOC_MARKDOWN_INFO,
119119
crate::doc::DOC_NESTED_REFDEFS_INFO,
120120
crate::doc::DOC_OVERINDENTED_LIST_ITEMS_INFO,
121+
crate::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION_INFO,
121122
crate::doc::DOC_SUSPICIOUS_FOOTNOTES_INFO,
122123
crate::doc::EMPTY_DOCS_INFO,
123124
crate::doc::MISSING_ERRORS_DOC_INFO,
@@ -777,7 +778,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
777778
crate::use_self::USE_SELF_INFO,
778779
crate::useless_concat::USELESS_CONCAT_INFO,
779780
crate::useless_conversion::USELESS_CONVERSION_INFO,
780-
crate::vec::USELESS_VEC_INFO,
781+
crate::useless_vec::USELESS_VEC_INFO,
781782
crate::vec_init_then_push::VEC_INIT_THEN_PUSH_INFO,
782783
crate::visibility::NEEDLESS_PUB_SELF_INFO,
783784
crate::visibility::PUB_WITHOUT_SHORTHAND_INFO,

0 commit comments

Comments
 (0)