{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/87940601","pull_request_review_id":8530364,"id":87940601,"diff_hunk":"@@ -130,6 +130,18 @@ impl<A: Array> SmallVec<A> {\n             self.set_len(len + 1);\n         }\n     }\n+\n+    pub fn truncate(&mut self, len: usize) {\n+        unsafe {\n+            while len < self.len() {\n+                // Decrement len before the drop_in_place(), so a panic on Drop\n+                // doesn't re-drop the just-failed value.\n+                let len = self.len() - 1;","path":"src/librustc_data_structures/small_vec.rs","position":10,"original_position":10,"commit_id":"6db12d49e0baea9a3de68f97a7a7e4d1caca7d8f","original_commit_id":"a88145da0e5a4ba18f99cac2390e45b372768494","user":{"login":"nnethercote","id":1940286,"avatar_url":"https://avatars.githubusercontent.com/u/1940286?v=3","gravatar_id":"","url":"https://api.github.com/users/nnethercote","html_url":"https://github.com/nnethercote","followers_url":"https://api.github.com/users/nnethercote/followers","following_url":"https://api.github.com/users/nnethercote/following{/other_user}","gists_url":"https://api.github.com/users/nnethercote/gists{/gist_id}","starred_url":"https://api.github.com/users/nnethercote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnethercote/subscriptions","organizations_url":"https://api.github.com/users/nnethercote/orgs","repos_url":"https://api.github.com/users/nnethercote/repos","events_url":"https://api.github.com/users/nnethercote/events{/privacy}","received_events_url":"https://api.github.com/users/nnethercote/received_events","type":"User","site_admin":false},"body":"I can change it, but it's also worth noting that I copied this code (with minor modifications) from vec.rs.","created_at":"2016-11-15T03:09:07Z","updated_at":"2016-11-15T03:09:07Z","html_url":"https://github.com/rust-lang/rust/pull/37760#discussion_r87940601","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/37760","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/87940601"},"html":{"href":"https://github.com/rust-lang/rust/pull/37760#discussion_r87940601"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37760"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/37760","id":93501592,"html_url":"https://github.com/rust-lang/rust/pull/37760","diff_url":"https://github.com/rust-lang/rust/pull/37760.diff","patch_url":"https://github.com/rust-lang/rust/pull/37760.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37760","number":37760,"state":"open","locked":false,"title":"Type walker small vector","user":{"login":"nnethercote","id":1940286,"avatar_url":"https://avatars.githubusercontent.com/u/1940286?v=3","gravatar_id":"","url":"https://api.github.com/users/nnethercote","html_url":"https://github.com/nnethercote","followers_url":"https://api.github.com/users/nnethercote/followers","following_url":"https://api.github.com/users/nnethercote/following{/other_user}","gists_url":"https://api.github.com/users/nnethercote/gists{/gist_id}","starred_url":"https://api.github.com/users/nnethercote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnethercote/subscriptions","organizations_url":"https://api.github.com/users/nnethercote/orgs","repos_url":"https://api.github.com/users/nnethercote/repos","events_url":"https://api.github.com/users/nnethercote/events{/privacy}","received_events_url":"https://api.github.com/users/nnethercote/received_events","type":"User","site_admin":false},"body":"These two changes avoid allocations on some hot paths and speed up a few workloads (some from rustc-benchmarks, as well as the workload from #36799) by 1--2%.","created_at":"2016-11-14T03:01:24Z","updated_at":"2016-11-15T03:09:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"072664d5b0ca0e8504ba7dc17b529877429e5813","assignee":{"login":"arielb1","id":1830974,"avatar_url":"https://avatars.githubusercontent.com/u/1830974?v=3","gravatar_id":"","url":"https://api.github.com/users/arielb1","html_url":"https://github.com/arielb1","followers_url":"https://api.github.com/users/arielb1/followers","following_url":"https://api.github.com/users/arielb1/following{/other_user}","gists_url":"https://api.github.com/users/arielb1/gists{/gist_id}","starred_url":"https://api.github.com/users/arielb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielb1/subscriptions","organizations_url":"https://api.github.com/users/arielb1/orgs","repos_url":"https://api.github.com/users/arielb1/repos","events_url":"https://api.github.com/users/arielb1/events{/privacy}","received_events_url":"https://api.github.com/users/arielb1/received_events","type":"User","site_admin":false},"assignees":[{"login":"arielb1","id":1830974,"avatar_url":"https://avatars.githubusercontent.com/u/1830974?v=3","gravatar_id":"","url":"https://api.github.com/users/arielb1","html_url":"https://github.com/arielb1","followers_url":"https://api.github.com/users/arielb1/followers","following_url":"https://api.github.com/users/arielb1/following{/other_user}","gists_url":"https://api.github.com/users/arielb1/gists{/gist_id}","starred_url":"https://api.github.com/users/arielb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielb1/subscriptions","organizations_url":"https://api.github.com/users/arielb1/orgs","repos_url":"https://api.github.com/users/arielb1/repos","events_url":"https://api.github.com/users/arielb1/events{/privacy}","received_events_url":"https://api.github.com/users/arielb1/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/37760/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/37760/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/37760/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/6db12d49e0baea9a3de68f97a7a7e4d1caca7d8f","head":{"label":"nnethercote:TypeWalker-SmallVector","ref":"TypeWalker-SmallVector","sha":"6db12d49e0baea9a3de68f97a7a7e4d1caca7d8f","user":{"login":"nnethercote","id":1940286,"avatar_url":"https://avatars.githubusercontent.com/u/1940286?v=3","gravatar_id":"","url":"https://api.github.com/users/nnethercote","html_url":"https://github.com/nnethercote","followers_url":"https://api.github.com/users/nnethercote/followers","following_url":"https://api.github.com/users/nnethercote/following{/other_user}","gists_url":"https://api.github.com/users/nnethercote/gists{/gist_id}","starred_url":"https://api.github.com/users/nnethercote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnethercote/subscriptions","organizations_url":"https://api.github.com/users/nnethercote/orgs","repos_url":"https://api.github.com/users/nnethercote/repos","events_url":"https://api.github.com/users/nnethercote/events{/privacy}","received_events_url":"https://api.github.com/users/nnethercote/received_events","type":"User","site_admin":false},"repo":{"id":21260858,"name":"rust","full_name":"nnethercote/rust","owner":{"login":"nnethercote","id":1940286,"avatar_url":"https://avatars.githubusercontent.com/u/1940286?v=3","gravatar_id":"","url":"https://api.github.com/users/nnethercote","html_url":"https://github.com/nnethercote","followers_url":"https://api.github.com/users/nnethercote/followers","following_url":"https://api.github.com/users/nnethercote/following{/other_user}","gists_url":"https://api.github.com/users/nnethercote/gists{/gist_id}","starred_url":"https://api.github.com/users/nnethercote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnethercote/subscriptions","organizations_url":"https://api.github.com/users/nnethercote/orgs","repos_url":"https://api.github.com/users/nnethercote/repos","events_url":"https://api.github.com/users/nnethercote/events{/privacy}","received_events_url":"https://api.github.com/users/nnethercote/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nnethercote/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/nnethercote/rust","forks_url":"https://api.github.com/repos/nnethercote/rust/forks","keys_url":"https://api.github.com/repos/nnethercote/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nnethercote/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nnethercote/rust/teams","hooks_url":"https://api.github.com/repos/nnethercote/rust/hooks","issue_events_url":"https://api.github.com/repos/nnethercote/rust/issues/events{/number}","events_url":"https://api.github.com/repos/nnethercote/rust/events","assignees_url":"https://api.github.com/repos/nnethercote/rust/assignees{/user}","branches_url":"https://api.github.com/repos/nnethercote/rust/branches{/branch}","tags_url":"https://api.github.com/repos/nnethercote/rust/tags","blobs_url":"https://api.github.com/repos/nnethercote/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nnethercote/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nnethercote/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/nnethercote/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nnethercote/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/nnethercote/rust/languages","stargazers_url":"https://api.github.com/repos/nnethercote/rust/stargazers","contributors_url":"https://api.github.com/repos/nnethercote/rust/contributors","subscribers_url":"https://api.github.com/repos/nnethercote/rust/subscribers","subscription_url":"https://api.github.com/repos/nnethercote/rust/subscription","commits_url":"https://api.github.com/repos/nnethercote/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/nnethercote/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/nnethercote/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/nnethercote/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/nnethercote/rust/contents/{+path}","compare_url":"https://api.github.com/repos/nnethercote/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nnethercote/rust/merges","archive_url":"https://api.github.com/repos/nnethercote/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nnethercote/rust/downloads","issues_url":"https://api.github.com/repos/nnethercote/rust/issues{/number}","pulls_url":"https://api.github.com/repos/nnethercote/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/nnethercote/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/nnethercote/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nnethercote/rust/labels{/name}","releases_url":"https://api.github.com/repos/nnethercote/rust/releases{/id}","deployments_url":"https://api.github.com/repos/nnethercote/rust/deployments","created_at":"2014-06-27T01:56:48Z","updated_at":"2016-09-08T22:21:22Z","pushed_at":"2016-11-14T06:08:46Z","git_url":"git://github.com/nnethercote/rust.git","ssh_url":"git@github.com:nnethercote/rust.git","clone_url":"https://github.com/nnethercote/rust.git","svn_url":"https://github.com/nnethercote/rust","homepage":"http://www.rust-lang.org","size":307386,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"3316ef7f3685973c930562d813f940a0b6ff30d8","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","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://avatars.githubusercontent.com/u/5430905?v=3","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":"2016-11-15T02:26:46Z","pushed_at":"2016-11-15T02:12:27Z","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":524931,"stargazers_count":18995,"watchers_count":18995,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3650,"mirror_url":null,"open_issues_count":2886,"forks":3650,"open_issues":2886,"watchers":18995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37760"},"html":{"href":"https://github.com/rust-lang/rust/pull/37760"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/37760"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/37760/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37760/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/37760/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/6db12d49e0baea9a3de68f97a7a7e4d1caca7d8f"}}}}
{"actor":{"display_login":"nnethercote"}}