{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicdnzuicvithsucmngictfonfcmwn766fjvxk33paiyndjpkkvozy",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mlv3hi5widl2"
},
"path": "/t/could-you-borrow-a-bit/24300#post_6",
"publishedAt": "2026-05-15T09:18:21.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "The type family `&mut T` with `T: Sized` definitionally relies on the meaning of `size_of::<T>` for the underlying aliased memory region. So that's pretty much out or at the very least requires you to internally point to the type as `UnsafeCell<u8>` and so unfortunately the type will lose all noalias benefits.\n\nWhat's disappointing here is that it does not compose well with other independent references, i.e. since shared references are used to represent a unique one none of the builtin projection interfaces would work well here.\n\nAlso, if we consider representing full bitfields with an additional width property instead of or mixed in with single bits note that for the dynamic variant all pointer metadata must implement `Ord`; but how do you properly sort usizeĆusize? Probably tuple sorting where the start is compared first and the length only on mismatch (it's weird though, as an analogue is there an ordering relationship between all pointers to slices? we even have lint for this `ambiguous_wide_pointer_comparisons`).",
"title": "Could you borrow a bit?"
}