@@ -175,13 +175,13 @@ the future, however.
175
175
That is, instead of ` offset_of!(Foo, quank.zoop.2.quank[4]) ` , you'll have to
176
176
compute the offsets of each step manually, and sum them.
177
177
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
179
179
unsupported.
180
180
181
181
# Reference-level explanation
182
182
[ reference-level-explanation ] : #reference-level-explanation
183
183
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
185
185
similar to the following:
186
186
187
187
``` rs
@@ -229,8 +229,8 @@ particular, the implementation should not allocate space for an instance of
229
229
time) would otherwise be hard-coded, so in some cases it may reduce the risk
230
230
of a compatibility hazard.
231
231
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 .
234
234
235
235
# Rationale and alternatives
236
236
[ rationale-and-alternatives ] : #rationale-and-alternatives
@@ -273,8 +273,10 @@ considered:
273
273
support use in const (due to accessing the address of a raw pointer).
274
274
Changing both of these issues would be challenging, but may be possible.
275
275
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).
278
280
279
281
6 . Hold off until this can be integrated into some larger language feature, such
280
282
as C++-style pointer-to-field, Swift-style field paths, ...
0 commit comments