{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreialwtt6zdr4hk6xlkb5l6r2q3u3fonlypejncor7qa7mlutvyppcm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgeujcefyar2"
},
"path": "/t/interior-mutability-and-safety-of-ownership-transfer-in-rust/24055#post_9",
"publishedAt": "2026-03-06T00:12:55.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "ogg:\n\n> Another option would be to require: `K: Clone, V: Clone` and explicitly clone each KV-pair during migration. This should be sound, but it would also be inefficient in many cases.\n\nNote that calling `Clone::clone()` requires providing it a reference of type `&Self`, so, if `K` and `V` are caller-chosen types, this is equivalent to handing out references to the caller (or to a caller-provided function, at least). I am not familiar enough with your use case to say whether this is an unsoundness, but it's something to keep in mind whenever you consider using a `Clone` bound with unsafe code.",
"title": "Interior mutability and safety of ownership transfer in Rust"
}