{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/241445337","pull_request_review_id":184719567,"id":241445337,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTQ0NTMzNw==","diff_hunk":"@@ -1753,17 +1753,19 @@ bitflags! {\n     pub struct AdtFlags: u32 {\n         const NO_ADT_FLAGS        = 0;\n         const IS_ENUM             = 1 << 0;\n-        const IS_PHANTOM_DATA     = 1 << 1;\n-        const IS_FUNDAMENTAL      = 1 << 2;\n-        const IS_UNION            = 1 << 3;\n-        const IS_BOX              = 1 << 4;\n+        const IS_UNION            = 1 << 1;\n+        const IS_STRUCT           = 1 << 2;","path":"src/librustc/ty/mod.rs","position":19,"original_position":9,"commit_id":"b1a193d90b22e6d81a10a455802332ffbd413ccb","original_commit_id":"b1a193d90b22e6d81a10a455802332ffbd413ccb","user":{"login":"alexreg","id":67036,"node_id":"MDQ6VXNlcjY3MDM2","avatar_url":"https://avatars3.githubusercontent.com/u/67036?v=4","gravatar_id":"","url":"https://api.github.com/users/alexreg","html_url":"https://github.com/alexreg","followers_url":"https://api.github.com/users/alexreg/followers","following_url":"https://api.github.com/users/alexreg/following{/other_user}","gists_url":"https://api.github.com/users/alexreg/gists{/gist_id}","starred_url":"https://api.github.com/users/alexreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexreg/subscriptions","organizations_url":"https://api.github.com/users/alexreg/orgs","repos_url":"https://api.github.com/users/alexreg/repos","events_url":"https://api.github.com/users/alexreg/events{/privacy}","received_events_url":"https://api.github.com/users/alexreg/received_events","type":"User","site_admin":false},"body":"@petrochenkov That's why I thought (it's a `u32` regardless). Thanks. :-)","created_at":"2018-12-13T15:32:17Z","updated_at":"2018-12-13T15:32:17Z","html_url":"https://github.com/rust-lang/rust/pull/56225#discussion_r241445337","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/56225","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/241445337"},"html":{"href":"https://github.com/rust-lang/rust/pull/56225#discussion_r241445337"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56225"}},"in_reply_to_id":240706497},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/56225","id":233434138,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDM0MTM4","html_url":"https://github.com/rust-lang/rust/pull/56225","diff_url":"https://github.com/rust-lang/rust/pull/56225.diff","patch_url":"https://github.com/rust-lang/rust/pull/56225.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/56225","number":56225,"state":"open","locked":false,"title":"Implement RFC 2338, \"Type alias enum variants\"","user":{"login":"alexreg","id":67036,"node_id":"MDQ6VXNlcjY3MDM2","avatar_url":"https://avatars3.githubusercontent.com/u/67036?v=4","gravatar_id":"","url":"https://api.github.com/users/alexreg","html_url":"https://github.com/alexreg","followers_url":"https://api.github.com/users/alexreg/followers","following_url":"https://api.github.com/users/alexreg/following{/other_user}","gists_url":"https://api.github.com/users/alexreg/gists{/gist_id}","starred_url":"https://api.github.com/users/alexreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexreg/subscriptions","organizations_url":"https://api.github.com/users/alexreg/orgs","repos_url":"https://api.github.com/users/alexreg/repos","events_url":"https://api.github.com/users/alexreg/events{/privacy}","received_events_url":"https://api.github.com/users/alexreg/received_events","type":"User","site_admin":false},"body":"This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following.\r\n\r\n```rust\r\n#![feature(type_alias_enum_variants)]\r\n\r\nenum Foo {\r\n    Bar(i32),\r\n    Baz { i: i32 },\r\n}\r\n\r\ntype Alias = Foo;\r\n\r\nfn main() {\r\n    let t = Alias::Bar(0);\r\n    let t = Alias::Baz { i: 0 };\r\n    match t {\r\n        Alias::Bar(_i) => {}\r\n        Alias::Baz { i: _i } => {}\r\n    }\r\n}\r\n```\r\n\r\nSince `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern.\r\n\r\nFixes issues #56199 and #56611.\r\n\r\nN.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible.\r\n\r\n```rust\r\nOption::<u8>::None; // OK\r\nOption::None::<u8>; // OK, but lint in near future (hard error next edition?)\r\nAlias::<u8>::None; // OK\r\nAlias::None::<u8>; // Error\r\n```\r\n\r\nI do not know if this will need an FCP, but let's start one if so.","created_at":"2018-11-26T04:16:38Z","updated_at":"2018-12-13T15:32:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ceaf7c30eb39dcf3e5c210205b853372d812e9a6","assignee":{"login":"petrochenkov","id":5751617,"node_id":"MDQ6VXNlcjU3NTE2MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5751617?v=4","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"assignees":[{"login":"petrochenkov","id":5751617,"node_id":"MDQ6VXNlcjU3NTE2MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5751617?v=4","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":31942528,"node_id":"MDU6TGFiZWwzMTk0MjUyOA==","url":"https://api.github.com/repos/rust-lang/rust/labels/I-nominated","name":"I-nominated","color":"e10c02","default":false},{"id":583436937,"node_id":"MDU6TGFiZWw1ODM0MzY5Mzc=","url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-author","name":"S-waiting-on-author","color":"d3dddd","default":false},{"id":211668019,"node_id":"MDU6TGFiZWwyMTE2NjgwMTk=","url":"https://api.github.com/repos/rust-lang/rust/labels/T-lang","name":"T-lang","color":"bfd4f2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/56225/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/56225/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/56225/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/b1a193d90b22e6d81a10a455802332ffbd413ccb","head":{"label":"alexreg:type_alias_enum_variants","ref":"type_alias_enum_variants","sha":"b1a193d90b22e6d81a10a455802332ffbd413ccb","user":{"login":"alexreg","id":67036,"node_id":"MDQ6VXNlcjY3MDM2","avatar_url":"https://avatars3.githubusercontent.com/u/67036?v=4","gravatar_id":"","url":"https://api.github.com/users/alexreg","html_url":"https://github.com/alexreg","followers_url":"https://api.github.com/users/alexreg/followers","following_url":"https://api.github.com/users/alexreg/following{/other_user}","gists_url":"https://api.github.com/users/alexreg/gists{/gist_id}","starred_url":"https://api.github.com/users/alexreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexreg/subscriptions","organizations_url":"https://api.github.com/users/alexreg/orgs","repos_url":"https://api.github.com/users/alexreg/repos","events_url":"https://api.github.com/users/alexreg/events{/privacy}","received_events_url":"https://api.github.com/users/alexreg/received_events","type":"User","site_admin":false},"repo":{"id":115889469,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU4ODk0Njk=","name":"rust","full_name":"alexreg/rust","private":false,"owner":{"login":"alexreg","id":67036,"node_id":"MDQ6VXNlcjY3MDM2","avatar_url":"https://avatars3.githubusercontent.com/u/67036?v=4","gravatar_id":"","url":"https://api.github.com/users/alexreg","html_url":"https://github.com/alexreg","followers_url":"https://api.github.com/users/alexreg/followers","following_url":"https://api.github.com/users/alexreg/following{/other_user}","gists_url":"https://api.github.com/users/alexreg/gists{/gist_id}","starred_url":"https://api.github.com/users/alexreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexreg/subscriptions","organizations_url":"https://api.github.com/users/alexreg/orgs","repos_url":"https://api.github.com/users/alexreg/repos","events_url":"https://api.github.com/users/alexreg/events{/privacy}","received_events_url":"https://api.github.com/users/alexreg/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alexreg/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/alexreg/rust","forks_url":"https://api.github.com/repos/alexreg/rust/forks","keys_url":"https://api.github.com/repos/alexreg/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexreg/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexreg/rust/teams","hooks_url":"https://api.github.com/repos/alexreg/rust/hooks","issue_events_url":"https://api.github.com/repos/alexreg/rust/issues/events{/number}","events_url":"https://api.github.com/repos/alexreg/rust/events","assignees_url":"https://api.github.com/repos/alexreg/rust/assignees{/user}","branches_url":"https://api.github.com/repos/alexreg/rust/branches{/branch}","tags_url":"https://api.github.com/repos/alexreg/rust/tags","blobs_url":"https://api.github.com/repos/alexreg/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexreg/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexreg/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexreg/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexreg/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/alexreg/rust/languages","stargazers_url":"https://api.github.com/repos/alexreg/rust/stargazers","contributors_url":"https://api.github.com/repos/alexreg/rust/contributors","subscribers_url":"https://api.github.com/repos/alexreg/rust/subscribers","subscription_url":"https://api.github.com/repos/alexreg/rust/subscription","commits_url":"https://api.github.com/repos/alexreg/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexreg/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexreg/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexreg/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexreg/rust/contents/{+path}","compare_url":"https://api.github.com/repos/alexreg/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexreg/rust/merges","archive_url":"https://api.github.com/repos/alexreg/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexreg/rust/downloads","issues_url":"https://api.github.com/repos/alexreg/rust/issues{/number}","pulls_url":"https://api.github.com/repos/alexreg/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/alexreg/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/alexreg/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexreg/rust/labels{/name}","releases_url":"https://api.github.com/repos/alexreg/rust/releases{/id}","deployments_url":"https://api.github.com/repos/alexreg/rust/deployments","created_at":"2017-12-31T23:10:36Z","updated_at":"2017-12-31T23:10:58Z","pushed_at":"2018-12-13T05:33:14Z","git_url":"git://github.com/alexreg/rust.git","ssh_url":"git@github.com:alexreg/rust.git","clone_url":"https://github.com/alexreg/rust.git","svn_url":"https://github.com/alexreg/rust","homepage":"https://www.rust-lang.org","size":405877,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"da1527cb06c7245f83ca51903ea2a27631820215","user":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ3MTI=","name":"rust","full_name":"rust-lang/rust","private":false,"owner":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2018-12-13T14:39:03Z","pushed_at":"2018-12-13T14:41:01Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":407679,"stargazers_count":32463,"watchers_count":32463,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5391,"mirror_url":null,"archived":false,"open_issues_count":4725,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5391,"open_issues":4725,"watchers":32463,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56225"},"html":{"href":"https://github.com/rust-lang/rust/pull/56225"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/56225"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/56225/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56225/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56225/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/b1a193d90b22e6d81a10a455802332ffbd413ccb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexreg"}}