{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreif53zl2tu266dd2drsdd44dif3sxadw56oumnexnzc2m6y2cgll5e",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mlv3h7664e22"
},
"path": "/t/reducing-raw-pointer-footguns-preventing-reference-aliasing-violations-at-compile-time/24301#post_4",
"publishedAt": "2026-05-15T09:33:02.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "fuji-184:\n\n> It isn't for checking aliasing rules for raw pointers, because raw pointers themselves don't have aliasing rules\n\nIf you want to dereference a raw pointer, even without materializing a reference, there _are_ still aliasing rules you need to follow. They're just looser and finer-grained than the rules for `&` and `&mut` references. A write through one raw pointer can still invalidate other raw pointers (such that reading or writing through those pointers would be UB). (See the `std::ptr` module's docs.)\n\nfuji-184:\n\n> My motivation for creating this is that many people say unsafe Rust is difficult because of the aliasing rules.\n\nIn part no doubt because Rust hasn't fully defined its aliasing rules yet. Seems to be several years out still.",
"title": "Reducing Raw Pointer Footguns: Preventing Reference Aliasing Violations at Compile Time"
}