The example shows an unaligned field (since it's packed), but that doesn't excuse everything. "Note, however, that the expr
in addr_of!(expr)
is still subject to all the usual rules." -- I think this would include alignment for (*f_ptr)
, although the docs only call out null pointers.
Miri is happy with addr_of!((*u_ptr).0.b)
.