Skip to content

transmute_mut! documents looser requirements than what is implemented #1046

Closed

Description

transmute_mut! documents the requirements that:

  • T: Sized + IntoBytes
  • U: Sized + FromBytes
  • align_of::<T>() >= align_of::<U>()

However, this is less strict that what is actually required:

  • T: FromBytes + IntoBytes + NoCell
  • U: FromBytes + IntoBytes + NoCell
  • size_of::<T>() == size_of::<U>()
  • align_of::<T>() >= align_of::<U>()

The size and NoCell requirements are also similarly missing from transmute_ref!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions