{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifpgumil5ov4j5h4pgjq476tcty6pmrcpnvmrm3acvahavb3nyshu",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mginek466rk2"
  },
  "path": "/t/idea-pre-rfc-null-free-pointer-and-zeroable-reference/23991?page=5#post_96",
  "publishedAt": "2026-03-07T19:35:34.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "H4n_uL:\n\n> That said, I'm not sure it alone would be sufficient for cases like the `DevTreeBlob` example in the OP, where the hardware places a structure at 0x0 on a 16-bit target with no spare RAM. There, what's needed is `&mut DevTreeBlob`\n\nA `&` or `&mut` at null will never happen, precisely for the reasons laid out earlier in this thread; references are never null, niche optimization, and both the compiler and the ecosystem count on both of those. The thing you wrote as \"instant UB\" is going to continue to be instant UB.\n\nBut given the appropriate low-level primitives, you'd be able to design a _different_ wrapper type, e.g. `AnywherePtr<T>`, which can contain a raw pointer value that's only used with those specific low-level primitives. And with upcoming work on field projection, you could go from an `AnywherePtr<MyStruct>` to an `AnywherePtr<FieldOfMyStruct>`. That could look _roughly_ like `let value = my_anywhere_ptr~field.read();` or `my_anywhere_ptr~field.write(value);` (where the exact operator in place of `~` is still TBD).",
  "title": "Idea / Pre-RFC: Null-free pointer and Zeroable reference"
}