Closed
Description
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
pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { ... }
struct Struct {
field: A,
}
struct A {
a: ((u8, u8), bool),
}
const OFFSET: usize = offset_of!(Struct, field.a.0.1);
Steps / History
- Implementation: Included in initial offset_of implementation
- Final comment period (FCP)1
- Stabilization PR - Stabilize offset_of_nested #128284
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(offset_of_nested)]`Relevant to the language team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.