{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/183871054","pull_request_review_id":114954285,"id":183871054,"diff_hunk":"@@ -543,6 +543,10 @@ impl<'a, 'b> Context<'a, 'b> {\n         let mut pats = Vec::new();\n         let mut heads = Vec::new();\n \n+        let names_pos: Vec<_> = (0..self.args.len()).map(|i| {","path":"src/libsyntax_ext/format.rs","position":4,"original_position":4,"commit_id":"27b0f1e1933280e7c5b242b1e2a1f02777e23c25","original_commit_id":"27b0f1e1933280e7c5b242b1e2a1f02777e23c25","user":{"login":"zofrex","id":22220,"avatar_url":"https://avatars3.githubusercontent.com/u/22220?v=4","gravatar_id":"","url":"https://api.github.com/users/zofrex","html_url":"https://github.com/zofrex","followers_url":"https://api.github.com/users/zofrex/followers","following_url":"https://api.github.com/users/zofrex/following{/other_user}","gists_url":"https://api.github.com/users/zofrex/gists{/gist_id}","starred_url":"https://api.github.com/users/zofrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofrex/subscriptions","organizations_url":"https://api.github.com/users/zofrex/orgs","repos_url":"https://api.github.com/users/zofrex/repos","events_url":"https://api.github.com/users/zofrex/events{/privacy}","received_events_url":"https://api.github.com/users/zofrex/received_events","type":"User","site_admin":false},"body":"This had to go all the way up here because... something to do with E0382. Self gets moved into the expression below with `pieces`? This can go further down if we have a mutable array in the loop and push names onto it, but I assumed we would prefer to avoid mutability.","created_at":"2018-04-24T20:34:53Z","updated_at":"2018-04-24T20:34:53Z","html_url":"https://github.com/rust-lang/rust/pull/49986#discussion_r183871054","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/49986","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/183871054"},"html":{"href":"https://github.com/rust-lang/rust/pull/49986#discussion_r183871054"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/49986"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/49986","id":181717780,"html_url":"https://github.com/rust-lang/rust/pull/49986","diff_url":"https://github.com/rust-lang/rust/pull/49986.diff","patch_url":"https://github.com/rust-lang/rust/pull/49986.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/49986","number":49986,"state":"open","locked":false,"title":"Provide better names for builtin deriving-generated attributes","user":{"login":"zofrex","id":22220,"avatar_url":"https://avatars3.githubusercontent.com/u/22220?v=4","gravatar_id":"","url":"https://api.github.com/users/zofrex","html_url":"https://github.com/zofrex","followers_url":"https://api.github.com/users/zofrex/followers","following_url":"https://api.github.com/users/zofrex/following{/other_user}","gists_url":"https://api.github.com/users/zofrex/gists{/gist_id}","starred_url":"https://api.github.com/users/zofrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofrex/subscriptions","organizations_url":"https://api.github.com/users/zofrex/orgs","repos_url":"https://api.github.com/users/zofrex/repos","events_url":"https://api.github.com/users/zofrex/events{/privacy}","received_events_url":"https://api.github.com/users/zofrex/received_events","type":"User","site_admin":false},"body":"First attempt at fixing #49967\r\n\r\nNot in love with any choices here, don't be shy if you aren't happy with anything :)\r\n\r\nI've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable)\r\n\r\nIn all cases I took the names from the methods as declared in the relevant trait.\r\n\r\nIn some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used?\r\n\r\nLastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)","created_at":"2018-04-15T20:02:39Z","updated_at":"2018-04-24T20:34:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e542232a6806a6ca79705f7a9206807e3f52981","assignee":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars2.githubusercontent.com/u/1617736?v=4","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"assignees":[{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars2.githubusercontent.com/u/1617736?v=4","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":583436937,"url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-author","name":"S-waiting-on-author","color":"d3dddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/49986/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/49986/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/49986/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/27b0f1e1933280e7c5b242b1e2a1f02777e23c25","head":{"label":"zofrex:better-derived-argument-names","ref":"better-derived-argument-names","sha":"27b0f1e1933280e7c5b242b1e2a1f02777e23c25","user":{"login":"zofrex","id":22220,"avatar_url":"https://avatars3.githubusercontent.com/u/22220?v=4","gravatar_id":"","url":"https://api.github.com/users/zofrex","html_url":"https://github.com/zofrex","followers_url":"https://api.github.com/users/zofrex/followers","following_url":"https://api.github.com/users/zofrex/following{/other_user}","gists_url":"https://api.github.com/users/zofrex/gists{/gist_id}","starred_url":"https://api.github.com/users/zofrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofrex/subscriptions","organizations_url":"https://api.github.com/users/zofrex/orgs","repos_url":"https://api.github.com/users/zofrex/repos","events_url":"https://api.github.com/users/zofrex/events{/privacy}","received_events_url":"https://api.github.com/users/zofrex/received_events","type":"User","site_admin":false},"repo":{"id":9281665,"name":"rust","full_name":"zofrex/rust","owner":{"login":"zofrex","id":22220,"avatar_url":"https://avatars3.githubusercontent.com/u/22220?v=4","gravatar_id":"","url":"https://api.github.com/users/zofrex","html_url":"https://github.com/zofrex","followers_url":"https://api.github.com/users/zofrex/followers","following_url":"https://api.github.com/users/zofrex/following{/other_user}","gists_url":"https://api.github.com/users/zofrex/gists{/gist_id}","starred_url":"https://api.github.com/users/zofrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofrex/subscriptions","organizations_url":"https://api.github.com/users/zofrex/orgs","repos_url":"https://api.github.com/users/zofrex/repos","events_url":"https://api.github.com/users/zofrex/events{/privacy}","received_events_url":"https://api.github.com/users/zofrex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zofrex/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/zofrex/rust","forks_url":"https://api.github.com/repos/zofrex/rust/forks","keys_url":"https://api.github.com/repos/zofrex/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zofrex/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zofrex/rust/teams","hooks_url":"https://api.github.com/repos/zofrex/rust/hooks","issue_events_url":"https://api.github.com/repos/zofrex/rust/issues/events{/number}","events_url":"https://api.github.com/repos/zofrex/rust/events","assignees_url":"https://api.github.com/repos/zofrex/rust/assignees{/user}","branches_url":"https://api.github.com/repos/zofrex/rust/branches{/branch}","tags_url":"https://api.github.com/repos/zofrex/rust/tags","blobs_url":"https://api.github.com/repos/zofrex/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zofrex/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zofrex/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/zofrex/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zofrex/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/zofrex/rust/languages","stargazers_url":"https://api.github.com/repos/zofrex/rust/stargazers","contributors_url":"https://api.github.com/repos/zofrex/rust/contributors","subscribers_url":"https://api.github.com/repos/zofrex/rust/subscribers","subscription_url":"https://api.github.com/repos/zofrex/rust/subscription","commits_url":"https://api.github.com/repos/zofrex/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/zofrex/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/zofrex/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/zofrex/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/zofrex/rust/contents/{+path}","compare_url":"https://api.github.com/repos/zofrex/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zofrex/rust/merges","archive_url":"https://api.github.com/repos/zofrex/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zofrex/rust/downloads","issues_url":"https://api.github.com/repos/zofrex/rust/issues{/number}","pulls_url":"https://api.github.com/repos/zofrex/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/zofrex/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/zofrex/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zofrex/rust/labels{/name}","releases_url":"https://api.github.com/repos/zofrex/rust/releases{/id}","deployments_url":"https://api.github.com/repos/zofrex/rust/deployments","created_at":"2013-04-07T19:10:48Z","updated_at":"2018-04-19T12:19:09Z","pushed_at":"2018-04-24T20:31:33Z","git_url":"git://github.com/zofrex/rust.git","ssh_url":"git@github.com:zofrex/rust.git","clone_url":"https://github.com/zofrex/rust.git","svn_url":"https://github.com/zofrex/rust","homepage":"http://www.rust-lang.org","size":364409,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"38e251ba37231f3471a20a13f503b191ed25a499","user":{"login":"rust-lang","id":5430905,"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,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"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},"private":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-04-24T20:33:17Z","pushed_at":"2018-04-24T20:31:37Z","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":369025,"stargazers_count":27845,"watchers_count":27845,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4868,"mirror_url":null,"archived":false,"open_issues_count":3688,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4868,"open_issues":3688,"watchers":27845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/49986"},"html":{"href":"https://github.com/rust-lang/rust/pull/49986"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/49986"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/49986/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/49986/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/49986/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/27b0f1e1933280e7c5b242b1e2a1f02777e23c25"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zofrex"}}