{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreic6kiamlmvluv2vhzbelm2jvgg2is2dzrwyhi6aisvloyyypitsku",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mnbxmewpypi2"
},
"path": "/t/include-racy-reads-in-rust-memory-model-with-maybeinvalid-t/24289?page=3#post_45",
"publishedAt": "2026-06-01T08:08:38.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Oh sorry, I missed the `RwLock`. That has a different size than `T` so this doesn't literally work, but I guess we could imagine that the RwLock state is stored out-of-band.\n\nThe `return T::default()` is wrong though since the asm code may return a different value.\n\nAnd generally that story is pretty far from what the asm actually does so arguing that the asm is a refinement of this code is far from trivial. For instance, the story code performs a bunch of synchronization (the `try_read` internally does an \"acquire\"), while the asm code doesn't do the same synchronization -- but for the story to be valid the asm code has to perform at least as much synchronization as the story.",
"title": "Include racy reads in Rust memory model with `MaybeInvalid<T>`"
}