-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Mutable Static docs (owned pointers / sync) #25851
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
Comments
whoah, we still have 'owned pointers' in an error message? |
@steveklabnik I'm planning on tackling this by adding an error code and an explanation. What do you think the error message should be instead? |
Yes, thanks! |
The E0397 explanation, as I've written it, isn't really an explanation, but I'm not sure what to put here. I will happily take suggestions. Partially addresses rust-lang#25851
The E0397 explanation, as I've written it, isn't really an explanation, but I'm not sure what to put here. I will happily take suggestions. Partially addresses rust-lang#25851
Still some references left to this old term, I've updated them to say boxes. Related to rust-lang#25851
This error now says 'hello.rs:1:38: 1:42 error: mutable statics are not allowed to have boxes [E0397]' on nightly |
Yes, however the "explanation" is still lacking I think. It just says
Not really an explanation ;) Also, RFC 246, which introduced this error, doesn't discuss this topic from what I read, so I'm not exactly sure why this is disallowed. |
…crichton Fixes rust-lang#25851 I am 99% sure this is true for all `static`s and not just `static mut`, yes?
Still some references left to this old term, I've updated them to say boxes. Related to rust-lang#25851
I am not sure why this is forbidden, but it is certainly undocumented.
Also the TRPL says
Furthermore, any type stored in a static must be Sync.
but does not mention that this is not true for static mut's.The text was updated successfully, but these errors were encountered: