Stabilize transmute in constants and statics but not const fn#64011
Stabilize transmute in constants and statics but not const fn#64011oli-obk wants to merge 1 commit intorust-lang:masterfrom
transmute in constants and statics but not const fn#64011Conversation
|
Why not also stabilize them in const fn? |
|
If we permit |
|
☔ The latest upstream changes (presumably #64026) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Hmm... I'm skeptical about diverging |
It might not be UB though, just reading the wrong data, if e.g. a Given that
That's fair. OTOH, I feel like |
|
I also think stabilization should be blocked on #61495 being resolved. We should make sure our intrinsic const checks actually check what we want them to check, before stabilizing direct access to an intrinsic in CTFE. |
|
Ping from triage |
|
I'll close this until #61495 is resolved. |
|
Uh, I just realized this scheme isn't possible anymore. We either stabilize |
|
@oli-obk could you explain why? |
|
@oli-obk should we give this another try? Not much progress has been made on the unconst side of things, but allowing |
|
Before we do that we should probably get rid of the extra Oh well, we could just do it in |
|
Ah, trying that I now remember what the problem is: we declare intrinsics to be stable by adding the |
|
let's continue any further discussion in #53605 |
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
Stabilize `transmute` in constants and statics but not const fn cc rust-lang#53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: rust-lang#64011 r? @RalfJung cc @rust-lang/wg-const-eval
r? @Centril
We already have
unions inside constants and it's strictly better to usetransmutefor transmutation purposes since you also get a size check.