{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiasoaqrrbgsgahqm7krwnpl4pnbmizajhhfr456zn3scp3xqsrkgi",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mg6fyycgund2"
  },
  "path": "/t/f-pattern-types-subsets-enums-using-as/24048#post_7",
  "publishedAt": "2026-03-03T04:26:37.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "Based on the syntax supported by pattern types (when they emerge) would my example be re-worked to be like:\n\n\n    #[derive(Debug, Error)]\n    pub enum MyError {\n        #[error(\"not found\")]\n        NotFound,\n\n        #[error(\"invalid state\")]\n        InvalidState,\n\n        #[error(\"permission denied\")]\n        PermissionDenied,\n    }\n\n\n    pub enum MyErrorSubset {\n        NotFound is MyError::NotFound,\n        PermissionDenied is MyError::PermissionDenied,\n    }\n\n\nThis seems like making the parent a repr type and using as.",
  "title": "F-pattern_types : Subsets enums using as"
}