{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreif5nirivmygkztt6qhatztonat6ygqgpzlup7lk447isunceav4my",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mg5l5zgjmb42"
},
"path": "/t/subset-enums/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": "Subset enums"
}