{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibdhjw3gzrb4ovap3mp4okuobjvwo6rkdxmtzc2gvhjbc3tz2lznm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mktxe372knt2"
},
"path": "/t/bitslice-or-a-sound-way-to-implement-one/24194#post_10",
"publishedAt": "2026-05-02T04:38:01.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "I would really like to just have a `u1` type where `Vec<u1>` and `[u1]` behave as you'd expect. For this to be possible without breaking everything you'd need at least:\n\n * A new `BitSized` built-in trait where `Sized: BitSized`.\n * For `u1` to _not_ implement `Sized` (because it doesn't have a size expressible in bytes).\n * To relax the bounds on `Vec<T>` and `[T]` to just be `T: BitSized`.\n\n\n\nI don't know how feasible this is on the codegen side of things though, eg. if you have two `&mut [u1]` that overlap the same byte.",
"title": "`BitSlice` or a sound way to implement one"
}