{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibtsbh4uhjszjigxdun3uux2ijvxhopplukuu3iazi676zpoxhfwu",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mpro6clpobe2"
  },
  "path": "/t/language-vision-regarding-safety-guarantees/24418?page=3#post_45",
  "publishedAt": "2026-07-03T22:32:26.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "[1]",
    "↩︎"
  ],
  "textContent": "ais523:\n\n> So my view now is more along the lines of \"there are _some parts of_ the standard library that it makes sense for unsafe code to rely on for soundness, but this doesn't apply to the whole standard library\"\n\nI'm actually also of this view. Some items get the full logic contract as safety guarantees (your first category). Some items get no safety guarantees (some of your third category). And the rest gets more custom safety guarantees (like `<f64 as Display>` could provide an upper bound on the formatted length[1]) depending on what is reasonable to guarantee and potentially useful in practice.\n\ntczajka:\n\n> _Users_ of a crate get to decide whether to trust a crate for correctness, and they also get to decide whether to trust a crate for safety.\n\nThe question is not who gets to decide whether to trust a crate for something, the question is who gets to decide the something of a crate that its clients may decide to trust. Obviously it's the client who must trust its dependencies (and reciprocally). That's how contracts work. It doesn't make sense to trust yourself.\n\nI think you misunderstood the sentence \"Should the clients of those crates decide instead independently\". The question is about deciding the safety contract, not about whether to trust it or not. This last part is obviously up to the client. Today (both with the convention and with the Rust Hypothesis), the safety guarantees are decided by the language. The safety requirements are also decided by the language for the safe parts of the public API, but they are decided by the crate for the unsafe parts.\n\n* * *\n\n  1. that's just a hypothetical example, I'm not suggesting this ↩︎\n\n\n",
  "title": "Language vision regarding safety guarantees"
}