{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1450","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1450/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1450/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1450/events","html_url":"https://github.com/rust-lang/rfcs/pull/1450","id":125480051,"number":1450,"title":"Variant types and untagged enums","user":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-lang","name":"T-lang","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2016-01-07T20:39:49Z","updated_at":"2016-01-08T01:22:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1450","html_url":"https://github.com/rust-lang/rfcs/pull/1450","diff_url":"https://github.com/rust-lang/rfcs/pull/1450.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1450.patch"},"body":"This is something of a two-part RFC, it proposes\r\n\r\n* making enum variants first-class types,\r\n* untagged enums (aka unions).\r\n\r\nThe latter is part of the motivation for the former and relies on the former to\r\nbe ergonomic.\r\n\r\nIn the service of making variant types work, there is some digression into\r\ndefault type parameters for functions. However, that needs its own RFC to be\r\nspec'ed properly."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/169860067","html_url":"https://github.com/rust-lang/rfcs/pull/1450#issuecomment-169860067","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1450","id":169860067,"user":{"login":"mahkoh","id":1882250,"avatar_url":"https://avatars.githubusercontent.com/u/1882250?v=3","gravatar_id":"","url":"https://api.github.com/users/mahkoh","html_url":"https://github.com/mahkoh","followers_url":"https://api.github.com/users/mahkoh/followers","following_url":"https://api.github.com/users/mahkoh/following{/other_user}","gists_url":"https://api.github.com/users/mahkoh/gists{/gist_id}","starred_url":"https://api.github.com/users/mahkoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahkoh/subscriptions","organizations_url":"https://api.github.com/users/mahkoh/orgs","repos_url":"https://api.github.com/users/mahkoh/repos","events_url":"https://api.github.com/users/mahkoh/events{/privacy}","received_events_url":"https://api.github.com/users/mahkoh/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T01:22:01Z","updated_at":"2016-01-08T01:22:01Z","body":"There is also a need for non-anonymous variants. E.g.\r\n\r\n```rust\r\n#[repr(C)]\r\nstruct TagVariant {\r\n    vt: VARTYPE,\r\n    variant: tagVARIANTvariant,\r\n}\r\n\r\n#[repr(union)]\r\nenum tagVARIANTtag {\r\n    __tagVARIANT: TagVariant,\r\n    // other fields here I've taken out\r\n}\r\n```"}}