Make transmute_copy
docs read better
This commit is contained in:
parent
b629c85bd7
commit
e241d5a093
@ -1000,7 +1000,7 @@ pub fn copy<T: Copy>(x: &T) -> T {
|
||||
///
|
||||
/// This function will unsafely assume the pointer `src` is valid for [`size_of::<U>`][size_of]
|
||||
/// bytes by transmuting `&T` to `&U` and then reading the `&U` (except that this is done in a way
|
||||
/// that is correct even when `&U` makes stricter alignment requirements than `&T`). It will also
|
||||
/// that is correct even when `&U` has stricter alignment requirements than `&T`). It will also
|
||||
/// unsafely create a copy of the contained value instead of moving out of `src`.
|
||||
///
|
||||
/// It is not a compile-time error if `T` and `U` have different sizes, but it
|
||||
|
Loading…
x
Reference in New Issue
Block a user