Skip to content

add checks to the transmute intrinsic to only allow "safe" transmutes #33

Closed
@oli-obk

Description

@oli-obk

examples of unsafe transmutes:

  • 32-bit values that aren't valid unicode indices casted to char
  • &T -> &mut T
  • null value to a NonZero type

examples of transmutes that should be something else (warn?)

  • integer -> *const T (cast)
  • &T -> *const T (cast/coercion) (linted by clippy)
  • *const T -> &T (should be a deref) (linted by clippy)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions