{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/comments/173377794","pull_request_review_id":102558691,"id":173377794,"diff_hunk":"@@ -0,0 +1,107 @@\n+# Type and Lifetime Parameters\n+\n+> **<sup>Syntax</sup>**  \n+> _Generics_ :  \n+> &nbsp;&nbsp; `<` _GenericParams_ <sup>?</sup> `>`  \n+>  \n+> _GenericParams_ :  \n+> &nbsp;&nbsp; &nbsp;&nbsp; _LifetimeParams_  \n+> &nbsp;&nbsp; | ( _LifetimeParams_ `,` ) <sup>?</sup>\n+> _TypeParams_ `,` <sup>?</sup>  \n+>  \n+> _LifetimeParams_ :  \n+> &nbsp;&nbsp; _LifetimeParam_ (`,` _LifetimeParam_)<sup>\\*</sup>  \n+>  \n+> _LifetimeParam_ :  \n+> &nbsp;&nbsp; [LIFETIME_OR_LABEL] [_LifetimeBounds_]<sup>?</sup>  \n+>  \n+> _Lifetime_ :  \n+> &nbsp;&nbsp; &nbsp;&nbsp; [LIFETIME_OR_LABEL]  \n+> &nbsp;&nbsp; | `'static`  \n+>  \n+> _TypeParams_:  \n+> &nbsp;&nbsp; _TypeParam_ (`,` _TypeParam_)<sup>\\*</sup>  \n+>  \n+> _TypeParam_ :  \n+> &nbsp;&nbsp; [IDENTIFIER] [_TypeParamBounds_]<sup>?</sup> ( `=` [_Type_] )<sup>?</sup>  \n+\n+Functions, type aliases, structs, enumerations, unions, traits and\n+implementations may be *parameterized* by types and lifetimes. These parameters\n+are listed in angle brackets (`<...>`), after the name of the item (except for\n+implementations, where they come directly after `impl`) and before its\n+definition. Lifetime parameters must be declared before type parameters.\n+Some examples of items with type and lifetime parameters:\n+\n+```rust\n+fn foo<'a, T>() {}\n+trait A<U> {}\n+struct Ref<'a, T> where T: 'a { r: &'a T }\n+```\n+\n+Certain built in types: [references], [raw pointers], [arrays],\n+[slices][arrays], [tuples] and [function pointers], have lifetime or type\n+parameters as well, but use different syntax.\n+\n+## Where clauses\n+\n+> **<sup>Syntax</sup>**  \n+> _WhereClause_ :  \n+> &nbsp;&nbsp; `where` ( _WhereClauseItem_ ( `,` _WhereClauseItem_ )<sup>\\*</sup> `,`<sup>?</sup> )<sup>?</sup>  \n+>  \n+> _WhereClauseItem_ :  \n+> &nbsp;&nbsp; &nbsp;&nbsp; _LifetimeWhereClauseItem_  \n+> &nbsp;&nbsp; | _TypeBoundWhereClauseItem_  \n+>  \n+> _LifetimeWhereClauseItem_ :  \n+> &nbsp;&nbsp; [_Lifetime_](#type-and-lifetime-parameters) [_LifetimeBounds_]  \n+>  \n+> _TypeBoundWhereClauseItem_ :  \n+> &nbsp;&nbsp; _ForLifetimes_<sup>?</sup> [_Type_] `:` [_TypeParamBounds_]  \n+\n+Where clauses provide an alternative way to specify bounds on type and lifetime","path":"src/items/generics.md","position":61,"original_position":61,"commit_id":"80000d4530adbf2f7b40f930fe508d3304e87459","original_commit_id":"80000d4530adbf2f7b40f930fe508d3304e87459","user":{"login":"Havvy","id":731722,"avatar_url":"https://avatars0.githubusercontent.com/u/731722?v=4","gravatar_id":"","url":"https://api.github.com/users/Havvy","html_url":"https://github.com/Havvy","followers_url":"https://api.github.com/users/Havvy/followers","following_url":"https://api.github.com/users/Havvy/following{/other_user}","gists_url":"https://api.github.com/users/Havvy/gists{/gist_id}","starred_url":"https://api.github.com/users/Havvy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Havvy/subscriptions","organizations_url":"https://api.github.com/users/Havvy/orgs","repos_url":"https://api.github.com/users/Havvy/repos","events_url":"https://api.github.com/users/Havvy/events{/privacy}","received_events_url":"https://api.github.com/users/Havvy/received_events","type":"User","site_admin":false},"body":"Nit: Where clauses should be italicized. I've used `*` for this myself, and others have used `_`.","created_at":"2018-03-09T07:03:16Z","updated_at":"2018-03-09T07:49:42Z","html_url":"https://github.com/rust-lang-nursery/reference/pull/258#discussion_r173377794","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/comments/173377794"},"html":{"href":"https://github.com/rust-lang-nursery/reference/pull/258#discussion_r173377794"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258","id":172690063,"html_url":"https://github.com/rust-lang-nursery/reference/pull/258","diff_url":"https://github.com/rust-lang-nursery/reference/pull/258.diff","patch_url":"https://github.com/rust-lang-nursery/reference/pull/258.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/258","number":258,"state":"open","locked":false,"title":"Generic parameters","user":{"login":"matthewjasper","id":20113453,"avatar_url":"https://avatars1.githubusercontent.com/u/20113453?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewjasper","html_url":"https://github.com/matthewjasper","followers_url":"https://api.github.com/users/matthewjasper/followers","following_url":"https://api.github.com/users/matthewjasper/following{/other_user}","gists_url":"https://api.github.com/users/matthewjasper/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewjasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewjasper/subscriptions","organizations_url":"https://api.github.com/users/matthewjasper/orgs","repos_url":"https://api.github.com/users/matthewjasper/repos","events_url":"https://api.github.com/users/matthewjasper/events{/privacy}","received_events_url":"https://api.github.com/users/matthewjasper/received_events","type":"User","site_admin":false},"body":"Putting this up to get some feedback. Second PR contains all the major changes.\r\n\r\n* Add grammar for trait bounds and type parameters (and uses it for trait objects) based on the grammar from @brauliobz's [branch](https://brauliobz.github.io/rust-reference/grammar.html#items), as well as nikomatsakis's [parser](https://github.com/nikomatsakis/rustypop/blob/master/src/rusty.lalrpop) and jorendorff's [grammar](https://github.com/jorendorff/rust-grammar).\r\n* Gives lifetime parameters some recognition\r\n* Documents HRTB (breifly)\r\n\r\ncc #256 ","created_at":"2018-03-03T22:09:13Z","updated_at":"2018-03-09T07:49:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7020e44ba51a990a86290013c183d88922c924e3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/258/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/reference/statuses/80000d4530adbf2f7b40f930fe508d3304e87459","head":{"label":"matthewjasper:generic-parameters","ref":"generic-parameters","sha":"80000d4530adbf2f7b40f930fe508d3304e87459","user":{"login":"matthewjasper","id":20113453,"avatar_url":"https://avatars1.githubusercontent.com/u/20113453?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewjasper","html_url":"https://github.com/matthewjasper","followers_url":"https://api.github.com/users/matthewjasper/followers","following_url":"https://api.github.com/users/matthewjasper/following{/other_user}","gists_url":"https://api.github.com/users/matthewjasper/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewjasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewjasper/subscriptions","organizations_url":"https://api.github.com/users/matthewjasper/orgs","repos_url":"https://api.github.com/users/matthewjasper/repos","events_url":"https://api.github.com/users/matthewjasper/events{/privacy}","received_events_url":"https://api.github.com/users/matthewjasper/received_events","type":"User","site_admin":false},"repo":{"id":83927268,"name":"reference","full_name":"matthewjasper/reference","owner":{"login":"matthewjasper","id":20113453,"avatar_url":"https://avatars1.githubusercontent.com/u/20113453?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewjasper","html_url":"https://github.com/matthewjasper","followers_url":"https://api.github.com/users/matthewjasper/followers","following_url":"https://api.github.com/users/matthewjasper/following{/other_user}","gists_url":"https://api.github.com/users/matthewjasper/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewjasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewjasper/subscriptions","organizations_url":"https://api.github.com/users/matthewjasper/orgs","repos_url":"https://api.github.com/users/matthewjasper/repos","events_url":"https://api.github.com/users/matthewjasper/events{/privacy}","received_events_url":"https://api.github.com/users/matthewjasper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthewjasper/reference","description":"The Rust Reference","fork":true,"url":"https://api.github.com/repos/matthewjasper/reference","forks_url":"https://api.github.com/repos/matthewjasper/reference/forks","keys_url":"https://api.github.com/repos/matthewjasper/reference/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthewjasper/reference/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthewjasper/reference/teams","hooks_url":"https://api.github.com/repos/matthewjasper/reference/hooks","issue_events_url":"https://api.github.com/repos/matthewjasper/reference/issues/events{/number}","events_url":"https://api.github.com/repos/matthewjasper/reference/events","assignees_url":"https://api.github.com/repos/matthewjasper/reference/assignees{/user}","branches_url":"https://api.github.com/repos/matthewjasper/reference/branches{/branch}","tags_url":"https://api.github.com/repos/matthewjasper/reference/tags","blobs_url":"https://api.github.com/repos/matthewjasper/reference/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthewjasper/reference/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthewjasper/reference/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthewjasper/reference/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthewjasper/reference/statuses/{sha}","languages_url":"https://api.github.com/repos/matthewjasper/reference/languages","stargazers_url":"https://api.github.com/repos/matthewjasper/reference/stargazers","contributors_url":"https://api.github.com/repos/matthewjasper/reference/contributors","subscribers_url":"https://api.github.com/repos/matthewjasper/reference/subscribers","subscription_url":"https://api.github.com/repos/matthewjasper/reference/subscription","commits_url":"https://api.github.com/repos/matthewjasper/reference/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthewjasper/reference/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthewjasper/reference/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthewjasper/reference/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthewjasper/reference/contents/{+path}","compare_url":"https://api.github.com/repos/matthewjasper/reference/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthewjasper/reference/merges","archive_url":"https://api.github.com/repos/matthewjasper/reference/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthewjasper/reference/downloads","issues_url":"https://api.github.com/repos/matthewjasper/reference/issues{/number}","pulls_url":"https://api.github.com/repos/matthewjasper/reference/pulls{/number}","milestones_url":"https://api.github.com/repos/matthewjasper/reference/milestones{/number}","notifications_url":"https://api.github.com/repos/matthewjasper/reference/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthewjasper/reference/labels{/name}","releases_url":"https://api.github.com/repos/matthewjasper/reference/releases{/id}","deployments_url":"https://api.github.com/repos/matthewjasper/reference/deployments","created_at":"2017-03-04T21:56:14Z","updated_at":"2017-03-04T21:56:16Z","pushed_at":"2018-03-03T21:47:16Z","git_url":"git://github.com/matthewjasper/reference.git","ssh_url":"git@github.com:matthewjasper/reference.git","clone_url":"https://github.com/matthewjasper/reference.git","svn_url":"https://github.com/matthewjasper/reference","homepage":null,"size":2125,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"86b7c821e16c9e3e78897d6193314ca88a87e2f1","user":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":83575374,"name":"reference","full_name":"rust-lang-nursery/reference","owner":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/reference","description":"The Rust Reference","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/reference","forks_url":"https://api.github.com/repos/rust-lang-nursery/reference/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/reference/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/reference/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/reference/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/reference/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/reference/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/reference/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/reference/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/reference/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/reference/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/reference/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/reference/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/reference/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/reference/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/reference/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/reference/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/reference/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/reference/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/reference/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/reference/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/reference/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/reference/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/reference/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/reference/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/reference/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/reference/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/reference/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/reference/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/reference/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/reference/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/reference/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/reference/deployments","created_at":"2017-03-01T16:21:06Z","updated_at":"2018-03-09T02:28:43Z","pushed_at":"2018-03-08T20:04:25Z","git_url":"git://github.com/rust-lang-nursery/reference.git","ssh_url":"git@github.com:rust-lang-nursery/reference.git","clone_url":"https://github.com/rust-lang-nursery/reference.git","svn_url":"https://github.com/rust-lang-nursery/reference","homepage":"https://doc.rust-lang.org/nightly/reference/","size":2102,"stargazers_count":56,"watchers_count":56,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":55,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":55,"open_issues":46,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258"},"html":{"href":"https://github.com/rust-lang-nursery/reference/pull/258"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/issues/258"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/issues/258/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/258/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/reference/statuses/80000d4530adbf2f7b40f930fe508d3304e87459"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Havvy"}}