{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidxrjlptviihlcl34b7ljuatvsmc52art56vryusygflwl57qk5re",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mpk6ayvep4d2"
},
"path": "/t/language-vision-regarding-safety-guarantees/24418?page=2#post_25",
"publishedAt": "2026-06-30T23:21:27.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "ais523:\n\n> For the second requirement to hold, `btree_map::CursorMut::insert_before_unchecked` needs to be safe: otherwise, giving a `BTreeMap` a `K` with a broken `Ord` implementation is library UB, because it leads to an `unsafe` method being called without actually upholding its safety requirements.\n\nThis is wrong. It's OK for the function to exist and be `unsafe`. It's up to the caller to make sure they don't call it with invalid type / input combinations.",
"title": "Language vision regarding safety guarantees"
}