{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiefkf4oa73uocfqet3lt2mkjv3woh5ulzmdfsavj2qnsxpvdrqmf4",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgjial3rlhc2"
},
"path": "/t/idea-pre-rfc-null-free-pointer-and-zeroable-reference/23991?page=6#post_103",
"publishedAt": "2026-03-07T21:21:04.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Relying on field projection and reborrow means this solution depends on two RFCs that are both still open experiments. If either changes direction or stalls, the entire library path disappears. This is the weakest link.\n\nAlso, ergonomics matters more than it might seem - `field_definition!(S, field_name)` + `*field!(&mut T, field_name)` vs `pointer.field` won't be a minor difference when you're working with dozens of struct fields.\n\n\n impl<'t, Container, Field: 't> GetField<Container, Field> for &'t Container {\n type Output = &'t Field;\n fn get_field(self, field: FieldDefinition<Container, Field>) -> Self::Output {\n unsafe { &*ptr::from_ref(self).get_field(field) }\n }\n }\n\n\nThis is an instant UB when ptr is 0x0.",
"title": "Idea / Pre-RFC: Null-free pointer and Zeroable reference"
}