diff --git a/Cargo.toml b/Cargo.toml index ffa457b..8b82ddb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ min_const_generics = [] # MSRV 1.51: support arrays via min_const_generics wasm_simd = [] # MSRV 1.54.0: support wasm simd types aarch64_simd = [] # MSRV 1.59.0: support aarch64 simd types -must_cast = [] # MSRV 1.57.0: support the `must` module. +must_cast = [] # MSRV 1.64.0: support the `must` module. const_zeroed = [] # MSRV 1.75.0: support const `zeroed()` diff --git a/src/lib.rs b/src/lib.rs index aa2812b..cafab3b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,6 +123,8 @@ macro_rules! transmute { ($val:expr) => { ::core::mem::transmute_copy(&::core::mem::ManuallyDrop::new($val)) }; + // This arm is for use in const contexts, where the borrow required to use transmute_copy poses an issue + // since the compiler hedges that the type being borrowed could have interior mutability. ($srcty:ty; $dstty:ty; $val:expr) => { { union Transmute {