Make transmute_copy docs read better

This commit is contained in:
asquared31415 2022-07-26 05:59:44 -04:00 committed by GitHub
parent b629c85bd7
commit e241d5a093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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