{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1444","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1444/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1444/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1444/events","html_url":"https://github.com/rust-lang/rfcs/pull/1444","id":124908676,"number":1444,"title":"unions","user":{"login":"joshtriplett","id":162737,"avatar_url":"https://avatars.githubusercontent.com/u/162737?v=3","gravatar_id":"","url":"https://api.github.com/users/joshtriplett","html_url":"https://github.com/joshtriplett","followers_url":"https://api.github.com/users/joshtriplett/followers","following_url":"https://api.github.com/users/joshtriplett/following{/other_user}","gists_url":"https://api.github.com/users/joshtriplett/gists{/gist_id}","starred_url":"https://api.github.com/users/joshtriplett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshtriplett/subscriptions","organizations_url":"https://api.github.com/users/joshtriplett/orgs","repos_url":"https://api.github.com/users/joshtriplett/repos","events_url":"https://api.github.com/users/joshtriplett/events{/privacy}","received_events_url":"https://api.github.com/users/joshtriplett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/I-nominated","name":"I-nominated","color":"e11d21"},{"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":208,"created_at":"2016-01-05T06:53:39Z","updated_at":"2016-03-31T09:16:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1444","html_url":"https://github.com/rust-lang/rfcs/pull/1444","diff_url":"https://github.com/rust-lang/rfcs/pull/1444.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1444.patch"},"body":"RFC: native C-compatible unions via contextually recognized keyword `union`\r\n\r\nEDIT: After extensive discussion, and grammar experiments by @nikomatsakis to verify feasibility, this RFC and pull request now proposes recognizing `union` as a \"contextual keyword\", allowing `union` to introduce a union declaration while not breaking any existing code that uses `union` as an identifier.\r\n\r\nAs discussed in the alternatives section, proposals for unions in Rust have extensively explored possible variations on declaration syntax, including longer keywords (`untagged_union`), built-in syntax macros (`union!`), compound keywords (`unsafe union`), pragmas (`#[repr(union)] struct`), and combinations of existing keywords ([`unsafe enum`](https://github.com/rust-lang/rfcs/pull/724)).\r\n\r\n[Rendered](https://github.com/joshtriplett/rfcs/blob/untagged_union/text/0000-union.md)\r\n\r\n[Discussion on rust-internals](https://internals.rust-lang.org/t/pre-rfc-unsafe-enums-now-including-a-poll/2873)\r\n\r\n(edited by @nrc to add old title)"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/203838990","html_url":"https://github.com/rust-lang/rfcs/pull/1444#issuecomment-203838990","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1444","id":203838990,"user":{"login":"ubsan","id":3479021,"avatar_url":"https://avatars.githubusercontent.com/u/3479021?v=3","gravatar_id":"","url":"https://api.github.com/users/ubsan","html_url":"https://github.com/ubsan","followers_url":"https://api.github.com/users/ubsan/followers","following_url":"https://api.github.com/users/ubsan/following{/other_user}","gists_url":"https://api.github.com/users/ubsan/gists{/gist_id}","starred_url":"https://api.github.com/users/ubsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubsan/subscriptions","organizations_url":"https://api.github.com/users/ubsan/orgs","repos_url":"https://api.github.com/users/ubsan/repos","events_url":"https://api.github.com/users/ubsan/events{/privacy}","received_events_url":"https://api.github.com/users/ubsan/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T09:16:19Z","updated_at":"2016-03-31T09:16:19Z","body":"@nrc I don't think we do need to be able to infer all generics from any field. Unions are far closer to enums than structs; See something like `Option`: you cannot tell what a thing is if it's only `None`. I think unions should be treated similarly; you'll have to use each one of the generics in at least one of the fields."}}