Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for `static_recursion` #29719
Comments
aturon
added
T-lang
B-unstable
labels
Nov 9, 2015
This comment has been minimized.
This comment has been minimized.
|
See https://github.com/eefriedman/rust/blob/0eea0f6e907ff8c8a25a10004bede7b4621b50aa/src/test/run-pass/static-recursive.rs for an example of what this allows. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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). |
nikomatsakis
referenced this issue
Nov 17, 2015
Closed
translating statics/consts segfaults LLVM if order is wrong #29884
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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
|
vberger
referenced this issue
Apr 3, 2016
Closed
Windows can't be resized and move properly in some contextes #8
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Jan 17, 2017
•
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@rfcbot reviewed |
jan-hudec
added a commit
to rust-locale/rust-locale
that referenced
this issue
Jan 30, 2017
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 1, 2017
|
|
1 similar comment
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 1, 2017
|
|
rfcbot
added
the
final-comment-period
label
Feb 1, 2017
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 11, 2017
|
The final comment period is now complete. |
aturon commentedNov 9, 2015
Added in #26630, allows recursive static variables. This issue tracks stabilization.