Skip to content

Add lint for & -> &mut transmutes #13146

Closed

Description

Doing a &T to &mut T transmute is now undefined behaviour (it needs to use the Unsafe type), and so there could be a lint for it.

Unfortunately, such a lint is likely to miss many such casts, but it will theoretically catch common cases like transmute::<&Foo, &mut Foo>(self).

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

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions