{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigatdrnjjbmhwx44wqn3eo4azur2edvi7rvs66buntpv7neqnxrwa",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3ml3otor5mm22"
  },
  "path": "/t/too-strict-orphan-rules-e0117/24221#post_4",
  "publishedAt": "2026-05-05T07:42:57.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "orphan rule",
    "local trait",
    "local type",
    "uncovered type"
  ],
  "textContent": "PC-Killer:\n\n> Is it possible to correct the behavior?\n\nit is not possible to correct the behavior because the behavior is correct.\n\nPC-Killer:\n\n> Here we implement `From<Option<Vec<T>>` for `Option<MyVec<T>>`, and the compiler reports that we voilate the orphan rule. However, `MyVec` is defined in the scope, so there's no chance that a more specialized overload will be defined in any other modules.\n\ni'm really not sure what you mean by \"more specialized\". what should stop downstream crates from mplementing `impl<T> From<Option<Vec<LocalTy<T>>>> for Option<MyVec<LocalTy<T>>>` ?\n\nPC-Killer:\n\n> However the compiler just reports that `Option<MyVec<i32>>` is foreign, which is a little _stupid_.\n\nits really not ; `Option<MyVec<i32>>` is local to the crate that defined `Option`, the same way `MyVec<i32>` is local to your crate, and not `core`, that defined `i32`.\n\nPC-Killer:\n\n> This proves that similar case _does_ make sense, while still being rejected by the compiler.\n\ni am very confused as to what this is supposed to prove ?\n\nthis is the current orphan rule\n\n> Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an `impl` is valid only if at least one of the following is true:\n>\n>   * `Trait` is a local trait\n>   * All of\n>     * At least one of the types `T0..=Tn` must be a local type. Let `Ti` be the first such type.\n>     * No uncovered type parameters `P1..=Pn` may appear in `T0..Ti` (excluding `Ti`)\n>\n\n\nif you think you can make a better one that is sound, feel free to do so, but very smart people have worked a long time on making it as relaxed as possible",
  "title": "Too strict orphan rules E0117"
}