-
Notifications
You must be signed in to change notification settings - Fork 13k
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
"Moving" out of a static could be a memcpy #13233
Comments
Moves out of static items were disallowed as part of 8784d2f Relaxing this to just mutable static items should be pretty straightforward. I'm tagging the issue as |
I'd be interested to try this. Is it correct that I would either have to add a new option to Edit: Ok, I guess that is unnecessary given that I can get the mutability through the I should probably add I'm talking about changing the |
@malu correct, you don't need to add anything to The change consists in adding an arm for |
Please see https://github.com/malu/rust/tree/issue-13233 and tell me if I did something wrong or if something is missing. |
@malu it's easier (and better) to comment on pull-requests. Would you mind submitting a PR ? I can provide feedback there. Thanks a lot for working on this. |
cc me |
This role is now filled by |
`declare_interior_mutable_const`: Ignore pointer types. fixes rust-lang#12951 fixes rust-lang#13233 changelog: `declare_interior_mutable_const`: Ignore pointer types.
`declare_interior_mutable_const`: Ignore pointer types. fixes rust-lang#12951 fixes rust-lang#13233 changelog: `declare_interior_mutable_const`: Ignore pointer types.
`declare_interior_mutable_const`: Ignore pointer types. fixes rust-lang#12951 fixes rust-lang#13233 changelog: `declare_interior_mutable_const`: Ignore pointer types.
`declare_interior_mutable_const`: Ignore pointer types. fixes rust-lang#12951 fixes rust-lang#13233 changelog: `declare_interior_mutable_const`: Ignore pointer types.
This was discussed at the recent work week, but it appears that our notes to not reflect a decision one way or another. I would expect this code to compile:
Specifically, you can "move" out of any non-
mut
static, it just turns in to a memcpy. The contents of the static have already been validated to not own anything and have no destructors, so this should be safe.The text was updated successfully, but these errors were encountered: