{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiauropfcqgvw24j5snc472kcfcgaju74w4gtm6fze3ksgbsfplraa",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgdfjjlo2up2"
},
"path": "/t/interior-mutability-and-safety-of-ownership-transfer-in-rust/24055#post_4",
"publishedAt": "2026-03-05T15:50:55.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "ogg:\n\n> A containing a \"non-owning\" `Vec<T>` accessed via shared reference by some threads while simultaneously a new Buffer B containing a bit-wise copy of the same `Vec<T>` and logical ownership of it is accessed via shared references by other threads.\n\nIf \"non-owning\" includes `&mut Vec<T>`, then no. What if the `Vec<T>` is at capacity and both copies call `push`? Then you get a double free . More generally `&mut` means exclusive, so `&mut v1[0]` and `&mut v2[0]` is UB on its own.\n\nIf by \"non-owning\" you mean `&Vec<T>`, you will need better languish lawyers then me.",
"title": "Interior mutability and safety of ownership transfer in Rust"
}