-
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
Tracking Issue for nested field access in offset_of #120140
Comments
This has been split off from #106655 to get the non-nested How the syntax for nested access should look like is still subject to discussion, especially also how it relates to enums. Some links:
|
Could the top example be updated to show what |
How close is this to stabilization? It looks like this is in use by the Linux kernel (https://lore.kernel.org/rust-for-linux/CAH5fLgjP98pS1wsP=YXP5Yr79Y62VF7XPKjbj+G75B3SOFt80g@mail.gmail.com/), as well as the standard library (for an enum): rust/library/core/src/option.rs Line 787 in 13e2d72
Stabilizing this may restrict future changes to the offset_of parsing logic (compiler/rustc_parse/src/parser/expr.rs:1191, parse_floating_field_access). Currently this has enum variants treated the same as fields and (with parsing support only) array indexing using |
@rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
I'm unclear on whether this needs an RFC. I would defer to libs-api on that question though, since this is more a question of the syntax the macro supports than the capability it provides, and I think the syntax is more in the libs-api realm than the lang one (though it may be a bit of both). Regarding the syntax, there is still an open question about supporting enum variants in the future. I'm personally okay with moving forward with this subset for now, especially since I can imagine a syntax I don't dislike: @rfcbot reviewed |
@rfcbot reviewed I don't feel this requires an RFC. I think it is a natural extension to the existing functionality. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@rfcbot reviewed |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Rollup merge of rust-lang#128284 - GKFX:stabilize-offset-of-nested, r=dtolnay,jieyouxu Stabilize offset_of_nested Tracking issue rust-lang#120140. Closes rust-lang#120140. As the FCP is now nearing its end I have opened a stabilization PR. I have done this separately to the offset_of_enum feature, since that FCP has not started. `@rustbot` label F-offset_of_nested T-lang T-libs-api
Feature gate:
#![feature(offset_of_nested)]
This is a tracking issue for the use of nested field access in offset_of. This is currently implemented with dot-separated fields, like in C. The original RFC for offset_of was rust-lang/rfcs#3308.
Public API
Steps / History
Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: