Closed
Description
Feature gate: #![feature(const_transmute_copy)]
This is a tracking issue for making the function mem::transmute_copy
const fn
.
Public API
mod mem {
pub const unsafe fn transmute_copy<T, U>(src: &T) -> U;
}
Steps / History
- Implementation: Constify
copy
related functions #83091Final commenting period (FCP)Stabilization PR
Unresolved Questions
- None yet.
Activity
RalfJung commentedon Jun 14, 2021
RalfJung commentedon Jun 14, 2021
const_fn_transmute
,const_fn_union
#85769Finomnis commentedon Aug 28, 2023
Any news on this? I don't see anything holding it back; especially now that transmute itself is const.
EDIT: Never mind, I just saw #85769 (comment).
RalfJung commentedon Aug 28, 2023
Since
ptr.read()
is const-stable nowadays, I think this can be stabilized as well. Feel free to open a PR. :)Cc @rust-lang/wg-const-eval
Finomnis commentedon Aug 28, 2023
@RalfJung I didn't do this before, I am reading the docs for how to do this, and there's an rfcbot final commenting period thing. Should this be done? If yes, how? I probably don't have the rights to do it.
RalfJung commentedon Aug 28, 2023
You just need to prepare a PR. I can help get the FCP process started in the PR.
Auto merge of rust-lang#115520 - Finomnis:const_transmute_copy, r=dto…