-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize transmute
in constants and statics but not const fn
#64011
Conversation
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
union
s inside constants and it's strictly better to usetransmute
for transmutation purposes since you also get a size check.