Skip to content

Commit 8d58281

Browse files
committed
Add #[clippy::allow] attribute to const layout tests
1 parent 8c71848 commit 8d58281

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
## Changed
213213
## Removed
214214
## Fixed
215+
- Fix regression where the `const` layout tests were triggering the `unnecessary_operation` and `identity_op` clippy warnings.
215216
## Security
216217

217218
# 0.70.0 (2024-08-16)

bindgen-tests/tests/expectations/tests/test_mixed_header_and_header_contents.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/test_multiple_header_calls_in_builder.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen/codegen/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ impl CodeGenerator for TemplateInstantiation {
13131313
// #size_of_expr < #size, the subtraction will overflow, both
13141314
// of which print enough information to see what has gone wrong.
13151315
result.push(quote! {
1316+
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13161317
const _: () = {
13171318
[#size_of_err][#size_of_expr - #size];
13181319
[#align_of_err][#align_of_expr - #align];
@@ -2523,6 +2524,7 @@ impl CodeGenerator for CompInfo {
25232524

25242525
if compile_time {
25252526
result.push(quote! {
2527+
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25262528
const _: () = {
25272529
[#size_of_err][#size_of_expr - #size];
25282530
#check_struct_align

0 commit comments

Comments
 (0)