{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicjbukhfvi2p3xdnuxjrh2c3f6h2m72cy5bhw5gr3dbqrlm7624uq",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgineogfctu2"
},
"path": "/t/idea-pre-rfc-null-free-pointer-and-zeroable-reference/23991?page=5#post_95",
"publishedAt": "2026-03-07T18:47:15.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"93"
],
"textContent": "With CodesInChaos' suggestion in #93, couldn't the ergonomics be improved by a proc macro that rewrites something like this...\n\n\n #[foo]\n impl DevTreeBlob {\n fn blah(&mut self) -> u32 {\n self.xxx = 123;\n self.yyy\n }\n }\n\n\n...into something like this...\n\n\n impl DevTreeBlob {\n fn blah(ptr: *mut Self) -> u32 {\n core::ptr::write_memory(&raw mut ptr.xxx, 123);\n core::ptr::read_memory(&raw ptr.yyy)\n }\n }\n\n\n...and that would satisfy most of your needs?",
"title": "Idea / Pre-RFC: Null-free pointer and Zeroable reference"
}