Skip to content

Translation introduces UB for class with mutable field in unsafe #615

Open

Description

@lucic71

For methods that receive const receivers and have mutable fields, we do &self.x as *const T as *mut T to be able to write x. This introduces UB in the program because a later read of x assumes no write was taking place.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions