Skip to content

Commit

Permalink
tests: Warn on clippy::as_conversions
Browse files Browse the repository at this point in the history
`clippy::ptr_as_ptr`, `clippy::cast_lossless`,
`clippy::cast_possible_truncation`, `clippy::cast_possible_wrap` and
`clippy::cast_sign_loss` are all enabled by `clippy::as_conversions`,
with them all enabled we can now remove them and simply warn on
`clippy::as_conversions`.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
  • Loading branch information
Jonathan Woollett-Light committed Oct 9, 2023
1 parent 5a6f28d commit 9e27796
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 22 deletions.
6 changes: 1 addition & 5 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
[build]
target-dir = "build/cargo_target"
rustflags = [
"-Wclippy::ptr_as_ptr",
"-Wclippy::as_conversions",
"-Wclippy::undocumented_unsafe_blocks",
"-Wclippy::cast_lossless",
"-Wclippy::cast_possible_truncation",
"-Wclippy::cast_possible_wrap",
"-Wclippy::cast_sign_loss",
"-Wmissing_debug_implementations",
"-Wclippy::exit",
]
Expand Down
2 changes: 1 addition & 1 deletion src/net_gen/src/if_tun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/net_gen/src/iff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/net_gen/src/sockios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/virtio_gen/src/virtio_blk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/virtio_gen/src/virtio_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/virtio_gen/src/virtio_ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/virtio_gen/src/virtio_rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
missing_debug_implementations
)]
Expand Down
2 changes: 1 addition & 1 deletion src/vmm/src/arch_gen/x86/hyperv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
clippy::cast_lossless
)]
Expand Down
2 changes: 1 addition & 1 deletion src/vmm/src/arch_gen/x86/hyperv_tlfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
clippy::cast_lossless
)]
Expand Down
5 changes: 2 additions & 3 deletions src/vmm/src/arch_gen/x86/msr_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::undocumented_unsafe_blocks,
clippy::cast_lossless
clippy::as_conversions,
clippy::undocumented_unsafe_blocks
)]

pub const MSR_EFER: u32 = 0xc0000080;
Expand Down
5 changes: 2 additions & 3 deletions src/vmm/src/arch_gen/x86/perf_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::undocumented_unsafe_blocks,
clippy::cast_lossless
clippy::as_conversions,
clippy::undocumented_unsafe_blocks
)]

pub const MSR_ARCH_PERFMON_PERFCTR0: u32 = 0xc1;
Expand Down
3 changes: 1 addition & 2 deletions tools/bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ function fc-bindgen {
non_upper_case_globals,
dead_code,
non_snake_case,
clippy::ptr_as_ptr,
clippy::as_conversions,
clippy::undocumented_unsafe_blocks,
clippy::cast_lossless,
missing_debug_implementations
)]
Expand Down

0 comments on commit 9e27796

Please sign in to comment.