Skip to content

Deprecation of copy_lifetime: "its questionable utility" is questionable #20888

@mzabaluev

Description

@mzabaluev

The unsafe utility function std::mem::copy_lifetime has been slapped with a deprecation notice:

this function may be removed in the future due to its questionable utility

Its utility, to me at least, is clear: it's a gentler hammer than std::mem::transmute for casting raw pointers into references. Now it is helpful to fix the shortcomings of raw pointer conversion functions (#20031), and if my RFC to improve those is accepted, it could be used to implement the lifetime-anchored variants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions