{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreic7m6k5hg7qzabv2rtoiv3yyxi4zdbclyy47ce3tuk6obpmzczeuq",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mg5l5ga7ktb2"
  },
  "path": "/t/subset-enums/24048#post_11",
  "publishedAt": "2026-03-03T06:16:55.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "DidingasLushis:\n\n> would my example be re-worked to be like:\n\nI would guess something like\n\n\n    type MyErrorSubset = MyError is (MyError::NotFound | MyError::PermissionDenied);\n\n\nThe hard question is whether `Result<T, MyErrorSubset>` can actually be any smaller if it's defined that way.\n\nIt's possible it'll have to be\n\n\n    struct MyErrorSubset(MyError is (MyError::NotFound | MyError::PermissionDenied));\n\n\nin order for `Result<T, MyErrorSubset>` to actually take layout advantage.\n\n(This kind of thing is one of the reasons it'll take a while to be stable.)",
  "title": "Subset enums"
}