Tracking Issue for #![feature(offset_of)]
· Issue #106655 · rust-lang/rust (original) (raw)
Feature gates tracked by this issue:
#![feature(offset_of)]
-> moved to Tracking Issue for enum access in offset_of #120141#![feature(offset_of_enum)]
This is a tracking issue for the offset_of!
macro which evaluates to a constant
containing the offset in bytes of a field inside some type (rust-lang/rfcs#3308).
Public API
// core::mem
pub macro offset_of($Container:ty, field:ttfield:tt field:tt(,)?) { // ...implementation defined... }
Steps / History
- Implementation: Add offset_of! macro (RFC 3308) #106934
- Split off
offset_of_enum
: Feature gate enums in offset_of #117537 - Final comment period (FCP)1: old, new
- Stabilization PR: Stabilize single-field offset_of #118799
Possible future extensions / work
- Support for static alignment DSTs (
struct Example(u32, [u8])
) - Support for
enum
s: Support enum variants in offset_of! #114208 - Improving diagnostics around the macro errors
Unresolved Questions
- None yet.