External Publication
Visit Post

Could you borrow a bit?

Rust Internals [Unofficial] May 18, 2026
Source

This looks…confused to me. Either use u8 (or, better, bit patterns in a single u8 for bit_offset and bit_len or the PhantomData needs to keep a reference to a [u8] slice. In any case, this only works for slices into bitfields up to USIZE_MAX / 4 bytes in length and starting at a bit in the first USIZE_MAX bits.

Discussion in the ATmosphere

Loading comments...