Skip to content

Should not use transmute to cast between pointers and integers #288

Closed

Description

Pointer to integer transmutes are almost certainly UB if you want to convert the resulting integer to a valid pointer again...you need a explicit pointer cast operation instead.
rust-lang/unsafe-code-guidelines#286

imho integer to pointer transmutes should be avoided too (even though they aren't necessarily UB), to go along with avoiding pointer to integer transmutes.

See also: #287

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

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: BugI-unsound💥Warning! Warning! Danger

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions