Skip to content

[tracking issue] const fn mem::forget #69616

@DutchGhost

Description

@DutchGhost
Contributor

mem::forget is just a thin wrapper around ManuallyDrop::new which is already a const fn. mem::forget can thus also be a const fn. The usage would be in const functions dealing with generics where you dont want the generics to get dropped.

  • documentation
    stabilization

Activity

added
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Mar 1, 2020
added a commit that references this issue on Mar 2, 2020
e725c04
changed the title [-]mem::forget can be a const fn[/-] [+][tracking issue] const fn mem::forget[/+] on Mar 13, 2020
added a commit that references this issue on Jul 11, 2020
efda2b5
ratijas

ratijas commented on Sep 6, 2020

@ratijas
Contributor

Just for the bookkeeping, with mem::forget stabilized by #73887, shouldn't the stabilization checkbox at the top become checked on?

DutchGhost

DutchGhost commented on Sep 6, 2020

@DutchGhost
ContributorAuthor

Just for the bookkeeping, with mem::forget stabilized by #73887, shouldn't the stabilization checkbox at the top become checked on?

Good point, checked the box now!

added
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
on Dec 1, 2024
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

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @RalfJung@jonas-schievink@ratijas@DutchGhost

      Issue actions

        [tracking issue] const fn mem::forget · Issue #69616 · rust-lang/rust