Skip to content

Commit eb6346c

Browse files
committed
Auto merge of #158403 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? Manishearth
2 parents 40557f6 + 91c04df commit eb6346c

347 files changed

Lines changed: 5183 additions & 3269 deletions

File tree

Some content is hidden

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

compiler/rustc_codegen_gcc/src/common.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,19 @@ pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) ->
5858
// or is it using a more efficient representation?
5959
match bytes.len() % 8 {
6060
0 => {
61+
debug_assert_eq!(
62+
bytes.len() % 8,
63+
0,
64+
"bytes length is not a multiple of 8, so bytes.as_chunks will have a remainder"
65+
);
6166
let context = &cx.context;
6267
let byte_type = context.new_type::<u64>();
6368
let typ = new_array_type(context, None, byte_type, bytes.len() as u64 / 8);
6469
let elements: Vec<_> = bytes
65-
.chunks_exact(8)
66-
.map(|arr| {
67-
let arr: [u8; 8] = arr.try_into().unwrap();
70+
.as_chunks::<8>()
71+
.0
72+
.iter()
73+
.map(|&arr| {
6874
context.new_rvalue_from_long(
6975
byte_type,
7076
// Since we are representing arbitrary byte runs as integers, we need to follow the target
@@ -79,13 +85,19 @@ pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) ->
7985
context.new_array_constructor(None, typ, &elements)
8086
}
8187
4 => {
88+
debug_assert_eq!(
89+
bytes.len() % 4,
90+
0,
91+
"bytes length is not a multiple of 4, so bytes.as_chunks will have a remainder"
92+
);
8293
let context = &cx.context;
8394
let byte_type = context.new_type::<u32>();
8495
let typ = new_array_type(context, None, byte_type, bytes.len() as u64 / 4);
8596
let elements: Vec<_> = bytes
86-
.chunks_exact(4)
87-
.map(|arr| {
88-
let arr: [u8; 4] = arr.try_into().unwrap();
97+
.as_chunks::<4>()
98+
.0
99+
.iter()
100+
.map(|&arr| {
89101
context.new_rvalue_from_int(
90102
byte_type,
91103
match cx.sess().target.options.endian {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: rustfoundation
2+
custom: [ "rust-lang.org/funding" ]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
# Setup
1818
- name: Checkout
19-
uses: actions/checkout@v6
19+
uses: actions/checkout@v7
2020
with:
2121
# Unsetting this would make so that any malicious package could get our Github Token
2222
persist-credentials: false

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

Lines changed: 4 additions & 4 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@v6
37+
uses: actions/checkout@v7
3838
with:
3939
persist-credentials: false
4040

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

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
# Setup
2626
- name: Checkout
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@v7
2828
with:
2929
# Unsetting this would make so that any malicious package could get our Github Token
3030
persist-credentials: false

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@v6
28+
uses: actions/checkout@v7
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@v6
34+
uses: actions/checkout@v7
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@v6
27+
uses: actions/checkout@v7
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@v6
83+
uses: actions/checkout@v7
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@v6
116+
uses: actions/checkout@v7
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
# Setup
1616
- name: Checkout
17-
uses: actions/checkout@v6
17+
uses: actions/checkout@v7
1818
with:
1919
# Unsetting this would make so that any malicious package could get our Github Token
2020
persist-credentials: false

src/tools/clippy/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6670,6 +6670,7 @@ Released 2018-09-13
66706670
[`boxed_local`]: https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local
66716671
[`branches_sharing_code`]: https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
66726672
[`builtin_type_shadow`]: https://rust-lang.github.io/rust-clippy/master/index.html#builtin_type_shadow
6673+
[`by_ref_peekable_peek`]: https://rust-lang.github.io/rust-clippy/master/index.html#by_ref_peekable_peek
66736674
[`byte_char_slices`]: https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices
66746675
[`bytes_count_to_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#bytes_count_to_len
66756676
[`bytes_nth`]: https://rust-lang.github.io/rust-clippy/master/index.html#bytes_nth
@@ -6694,6 +6695,7 @@ Released 2018-09-13
66946695
[`chars_last_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp
66956696
[`chars_next_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp
66966697
[`checked_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#checked_conversions
6698+
[`chunks_exact_to_as_chunks`]: https://rust-lang.github.io/rust-clippy/master/index.html#chunks_exact_to_as_chunks
66976699
[`clear_with_drain`]: https://rust-lang.github.io/rust-clippy/master/index.html#clear_with_drain
66986700
[`clone_double_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#clone_double_ref
66996701
[`clone_on_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
@@ -7457,6 +7459,7 @@ Released 2018-09-13
74577459
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
74587460
[`unnecessary_trailing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_trailing_comma
74597461
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
7462+
[`unnecessary_unwrap_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap_unchecked
74607463
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
74617464
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
74627465
[`unneeded_struct_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern
@@ -7571,6 +7574,7 @@ Released 2018-09-13
75717574
[`avoid-breaking-exported-api`]: https://doc.rust-lang.org/clippy/lint_configuration.html#avoid-breaking-exported-api
75727575
[`await-holding-invalid-types`]: https://doc.rust-lang.org/clippy/lint_configuration.html#await-holding-invalid-types
75737576
[`cargo-ignore-publish`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cargo-ignore-publish
7577+
[`check-grouped-late-init`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-grouped-late-init
75747578
[`check-incompatible-msrv-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-incompatible-msrv-in-tests
75757579
[`check-inconsistent-struct-field-initializers`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-inconsistent-struct-field-initializers
75767580
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
@@ -7608,7 +7612,6 @@ Released 2018-09-13
76087612
[`module-items-ordered-within-groupings`]: https://doc.rust-lang.org/clippy/lint_configuration.html#module-items-ordered-within-groupings
76097613
[`msrv`]: https://doc.rust-lang.org/clippy/lint_configuration.html#msrv
76107614
[`pass-by-value-size-limit`]: https://doc.rust-lang.org/clippy/lint_configuration.html#pass-by-value-size-limit
7611-
[`profiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#profiles
76127615
[`pub-underscore-fields-behavior`]: https://doc.rust-lang.org/clippy/lint_configuration.html#pub-underscore-fields-behavior
76137616
[`recursive-self-in-type-definitions`]: https://doc.rust-lang.org/clippy/lint_configuration.html#recursive-self-in-type-definitions
76147617
[`semicolon-inside-block-ignore-singleline`]: https://doc.rust-lang.org/clippy/lint_configuration.html#semicolon-inside-block-ignore-singleline

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@v6
18+
- uses: actions/checkout@v7
1919
- name: Run Clippy
2020
run: cargo clippy --all-targets --all-features
2121
```

0 commit comments

Comments
 (0)