Skip to content

Commit

Permalink
Address unexpected_cfgs warnings instead of allowing the lint (Loka…
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau authored and zachs18 committed Jun 6, 2024
1 parent 952f296 commit 0ebbc7a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ members = [
"bytemuck_derive"
]
resolver = "2"

[workspace.lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(target_arch, values("spirv"))'] }
3 changes: 3 additions & 0 deletions bytemuck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ features = [
"alloc",
"std",
]

[lints]
workspace = true
4 changes: 2 additions & 2 deletions bytemuck/src/nouninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ unsafe impl<T: NoUninit + ?Sized> NoUninit for core::cell::Cell<T> {}
unsafe impl<T, const N: usize> NoUninit for [T; N] where T: NoUninit {}

impl_unsafe_marker_for_simd!(
#[cfg(all(target_arch = "wasm32", feature = "wasm_simd"))]
#[cfg(target_arch = "wasm32")]
unsafe impl NoUninit for core::arch::wasm32::{v128}
);

impl_unsafe_marker_for_simd!(
#[cfg(all(target_arch = "aarch64", feature = "aarch64_simd"))]
#[cfg(target_arch = "aarch64")]
unsafe impl NoUninit for core::arch::aarch64::{
float32x2_t, float32x2x2_t, float32x2x3_t, float32x2x4_t, float32x4_t,
float32x4x2_t, float32x4x3_t, float32x4x4_t, float64x1_t, float64x1x2_t,
Expand Down
1 change: 0 additions & 1 deletion bytemuck/tests/array_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub fn test_cast_array() {
let _: [u16; 6] = bytemuck::cast(x);
}

#[cfg(feature = "min_const_generics")]
#[test]
pub fn test_cast_long_array() {
let x = [0u32; 65];
Expand Down
3 changes: 3 additions & 0 deletions bytemuck_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ proc-macro2 = "1.0.60"

[dev-dependencies]
bytemuck = { path = "../bytemuck", features = ["derive"] }

[lints]
workspace = true

0 comments on commit 0ebbc7a

Please sign in to comment.