-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: 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.Relevant to the library API team, which will review and decide on the PR/issue.
Description
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.
- To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: 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.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Rollup merge of rust-lang#69617 - DutchGhost:master, r=LukasKalbertodt
[-]mem::forget can be a const fn[/-][+][tracking issue] const fn mem::forget[/+]Rollup merge of rust-lang#73887 - DutchGhost:master, r=oli-obk
ratijas commentedon Sep 6, 2020
Just for the bookkeeping, with
mem::forget
stabilized by #73887, shouldn't the stabilization checkbox at the top become checked on?DutchGhost commentedon Sep 6, 2020
Good point, checked the box now!