-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking issue for static_recursion
#29719
Comments
See https://github.com/eefriedman/rust/blob/0eea0f6e907ff8c8a25a10004bede7b4621b50aa/src/test/run-pass/static-recursive.rs for an example of what this allows. |
Specifically, when we try to deref a pointer to a static, we must have its initializer available. So we cannot allow arbitrary recursive statics, or at least we need some rather more sophisticated technique to handle this on the LLVM side (like creating intermediate statics). |
We aren't supposed to allow dereferencing a static inside of another static... it's nonsensical at best. (Our current implementation even allows Once we correctly honor that restriction, we don't need the initializer. |
If I understand correctly, the only blocking point for this feature is dereferencing a pointer to a static in a static, which should actually completely be forbidden? So... no big problem? If so I'd love to see this feature advancing, I need it for my wayland crates, and there is no workaround, as I must match the rules of the C API I'm binding to. |
I think that is correct, but we do need to fix that bug first or else we On Tue, Feb 16, 2016 at 9:15 AM, Victor Berger notifications@github.com
|
Coming back at this, as it's been brought up again in my crates. So, is the fix you are talking about @nikomatsakis just "we should forbid dereferencing/indexing a static in an other static" ? If so, I might try to work on it, if I find the time to. |
It looks like the progress on stabilizing this has stalled, so I'll link a recent blog post that mentions this feature in the hopes that it will trigger another round of re-prioritization: http://blog.levans.fr/wayland_rust_v3-en.html |
From what I see in #33130 and on the playpen nightly, dereferencing a reference to a static in an other static is now disallowed (and has been for a few months). So... Is there still anything blocking the stabilization of |
I'd really like this to not remain completely stalled, this is absolutely crucial for a proper use of wayland with Rust. This is all the more frustrating that it appears to not be blocked on anything. |
@rfcbot fcp merge This feature (no RFC was ever required) permits statics to refer to other statics. Because statics are not supposed to refer to one another by value, this simply allows one to create interlinked structures. (Is this correct, @eefriedman?) There was at one time a bug in that we failed to prohibit statics from referring to one another by value, but that has since been fixed. This seems like a reasonable feature to stabilize, so I propose we do so. |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot reviewed |
Nightly-only until rust-lang/rust#29719 gets fixed. TODO: Actually extract the data.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
1 similar comment
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
…, r=nrc Stabilize static_recursion Fix rust-lang#29719.
…, r=nrc Stabilize static_recursion Fix rust-lang#29719.
…, r=nrc Stabilize static_recursion Fix rust-lang#29719.
Added in #26630, allows recursive static variables. This issue tracks stabilization.
The text was updated successfully, but these errors were encountered: