From ad6adf173e52f4498a51aba4c7edbd33fbdbd793 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Mon, 27 Mar 2023 15:14:23 -0400 Subject: [PATCH] Move `CastInPlace` behind a feature gate. --- Cargo.toml | 9 +++++++-- src/lib.rs | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9d6be11..05d7274 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,11 @@ extern_crate_std = ["extern_crate_alloc"] zeroable_maybe_uninit = [] zeroable_atomics = [] min_const_generics = [] -wasm_simd = [] # Until >= 1.54.0 is MSRV this is an off-by-default feature. -aarch64_simd = [] # Until >= 1.59.0 is MSRV this is an off-by-default feature. + +# Off-by-default while bytemuck's MSRV is raised. +wasm_simd = [] # Requires MSRV >= 1.54.0. +aarch64_simd = [] # Requires MSRV >= 1.59.0. +unified_cast = [] # Requires MSRV >= 1.65.0. # Do not use if you can avoid it, because this is unsound. unsound_ptr_pod_impl = [] @@ -42,6 +45,7 @@ features = [ "zeroable_atomics", "min_const_generics", "wasm_simd", + "unified_cast", ] [package.metadata.playground] @@ -54,4 +58,5 @@ features = [ "zeroable_atomics", "min_const_generics", "wasm_simd", + "unified_cast", ] diff --git a/src/lib.rs b/src/lib.rs index 2902c1d..4a755ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -125,7 +125,9 @@ pub use offset_of::*; mod transparent; pub use transparent::*; +#[cfg(feature = "unified_cast")] mod cast; +#[cfg(feature = "unified_cast")] pub use cast::CastInPlace; #[cfg(feature = "derive")]