Skip to content

Commit

Permalink
Add comment for transmute! macro new arm, and update Cargo.toml comme…
Browse files Browse the repository at this point in the history
…nt for must_cast MSRV.
  • Loading branch information
zachs18 committed Aug 11, 2024
1 parent f2846f9 commit e40626a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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()`

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<A, B> {
Expand Down

0 comments on commit e40626a

Please sign in to comment.