@@ -175,13 +175,13 @@ the future, however.
175175 That is, instead of ` offset_of!(Foo, quank.zoop.2.quank[4]) ` , you'll have to
176176 compute the offsets of each step manually, and sum them.
177177
178- 4 . Finally, types other than tuples, structs, and unions are not currently
178+ 4 . Finally, types other than tuples, structs, and unions are currently
179179 unsupported.
180180
181181# Reference-level explanation
182182[ reference-level-explanation ] : #reference-level-explanation
183183
184- ` offset_of ` is a new macro exported from ` core::mem ` which has an signature
184+ ` offset_of ` is a new macro exported from ` core::mem ` which has a signature
185185similar to the following:
186186
187187``` rs
@@ -229,8 +229,8 @@ particular, the implementation should not allocate space for an instance of
229229 time) would otherwise be hard-coded, so in some cases it may reduce the risk
230230 of a compatibility hazard.
231231
232- 2 . This is a low level feature that most code won't need to use, so perhaps it
233- is better off left out .
232+ 2 . This is a feature most code won't need to use, and it may be confusing to
233+ users unfamiliar with low level programming .
234234
235235# Rationale and alternatives
236236[ rationale-and-alternatives ] : #rationale-and-alternatives
@@ -273,8 +273,10 @@ considered:
273273 support use in const (due to accessing the address of a raw pointer).
274274 Changing both of these issues would be challenging, but may be possible.
275275
276- This was not chosen because seems difficult, and would be harder to teach
277- (or read) than ` core::mem::offset_of ` .
276+ This was not chosen because seems difficult, would be harder to teach (or
277+ read) than ` core::mem::offset_of ` , and is largely orthogonal to whether or
278+ not a dedicated field offset API is provided (in other words, fixing those
279+ issues seems unlikely to make ` offset_of! ` appear redundant).
278280
2792816 . Hold off until this can be integrated into some larger language feature, such
280282 as C++-style pointer-to-field, Swift-style field paths, ...
0 commit comments