{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/80682923","pull_request_review_id":1722941,"id":80682923,"diff_hunk":"@@ -1326,3 +1327,389 @@ impl Location {\n         }\n     }\n }\n+\n+/*\n+ * TypeFoldable implementations for MIR types\n+ */\n+\n+impl<'tcx> TypeFoldable<'tcx> for Mir<'tcx> {\n+    fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {\n+        Mir {\n+            basic_blocks: self.basic_blocks.fold_with(folder),\n+            visibility_scopes: self.visibility_scopes.clone(),\n+            promoted: self.promoted.fold_with(folder),\n+            return_ty: self.return_ty.fold_with(folder),\n+            var_decls:   self.var_decls.fold_with(folder),\n+            arg_decls:   self.arg_decls.fold_with(folder),\n+            temp_decls:  self.temp_decls.fold_with(folder),\n+            upvar_decls: self.upvar_decls.clone(),\n+            span: self.span,\n+            cache: Cache::new()\n+        }\n+    }\n+\n+    fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {\n+        self.basic_blocks.visit_with(visitor) ||\n+        self.promoted.visit_with(visitor)     ||\n+        self.return_ty.visit_with(visitor)    ||\n+        self.var_decls.visit_with(visitor)    ||\n+        self.arg_decls.visit_with(visitor)    ||\n+        self.temp_decls.visit_with(visitor)\n+    }\n+}\n+\n+impl<'tcx> TypeFoldable<'tcx> for VarDecl<'tcx> {\n+    fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {\n+        VarDecl {\n+            ty: self.ty.fold_with(folder),\n+            ..self.clone()\n+        }\n+    }\n+\n+    fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {\n+        self.ty.visit_with(visitor)\n+    }\n+}\n+\n+impl<'tcx> TypeFoldable<'tcx> for TempDecl<'tcx> {\n+    fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {\n+        TempDecl {\n+            ty: self.ty.fold_with(folder),\n+        }\n+    }\n+\n+    fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {\n+        self.ty.visit_with(visitor)\n+    }\n+}\n+\n+impl<'tcx> TypeFoldable<'tcx> for ArgDecl<'tcx> {\n+    fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {\n+        ArgDecl {\n+            ty: self.ty.fold_with(folder),\n+            ..self.clone()","path":"src/librustc/mir/repr.rs","position":81,"original_position":72,"commit_id":"76cc7cf058ad565349b5530425a3cac70551466f","original_commit_id":"5207298a2c2cfe322e351617915a92f70f5e0301","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"body":"Nit: similarly here (this way, if we add a new fields, we are likely to consider whether it needs to call `fold_with` or not)","created_at":"2016-09-27T12:46:41Z","updated_at":"2016-09-27T12:46:41Z","html_url":"https://github.com/rust-lang/rust/pull/36593#discussion_r80682923","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/36593","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/80682923"},"html":{"href":"https://github.com/rust-lang/rust/pull/36593#discussion_r80682923"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36593"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/36593","id":85907701,"html_url":"https://github.com/rust-lang/rust/pull/36593","diff_url":"https://github.com/rust-lang/rust/pull/36593.diff","patch_url":"https://github.com/rust-lang/rust/pull/36593.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/36593","number":36593,"state":"open","locked":false,"title":"[MIR] Initial implementation of inlining","user":{"login":"Aatch","id":342416,"avatar_url":"https://avatars.githubusercontent.com/u/342416?v=3","gravatar_id":"","url":"https://api.github.com/users/Aatch","html_url":"https://github.com/Aatch","followers_url":"https://api.github.com/users/Aatch/followers","following_url":"https://api.github.com/users/Aatch/following{/other_user}","gists_url":"https://api.github.com/users/Aatch/gists{/gist_id}","starred_url":"https://api.github.com/users/Aatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aatch/subscriptions","organizations_url":"https://api.github.com/users/Aatch/orgs","repos_url":"https://api.github.com/users/Aatch/repos","events_url":"https://api.github.com/users/Aatch/events{/privacy}","received_events_url":"https://api.github.com/users/Aatch/received_events","type":"User","site_admin":false},"body":"Implements basic inlining for MIR functions.\r\n\r\nInlining is currently only done if `mir-opt-level` is set to 2.\r\n\r\nDoes not handle debuginfo completely correctly at the moment.","created_at":"2016-09-20T04:02:54Z","updated_at":"2016-09-27T12:46:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3639778cc5d7c7ea973580454a8afbda0a7c142d","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/36593/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/36593/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/36593/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/76cc7cf058ad565349b5530425a3cac70551466f","head":{"label":"Aatch:mir-inlining","ref":"mir-inlining","sha":"76cc7cf058ad565349b5530425a3cac70551466f","user":{"login":"Aatch","id":342416,"avatar_url":"https://avatars.githubusercontent.com/u/342416?v=3","gravatar_id":"","url":"https://api.github.com/users/Aatch","html_url":"https://github.com/Aatch","followers_url":"https://api.github.com/users/Aatch/followers","following_url":"https://api.github.com/users/Aatch/following{/other_user}","gists_url":"https://api.github.com/users/Aatch/gists{/gist_id}","starred_url":"https://api.github.com/users/Aatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aatch/subscriptions","organizations_url":"https://api.github.com/users/Aatch/orgs","repos_url":"https://api.github.com/users/Aatch/repos","events_url":"https://api.github.com/users/Aatch/events{/privacy}","received_events_url":"https://api.github.com/users/Aatch/received_events","type":"User","site_admin":false},"repo":{"id":6915479,"name":"rust","full_name":"Aatch/rust","owner":{"login":"Aatch","id":342416,"avatar_url":"https://avatars.githubusercontent.com/u/342416?v=3","gravatar_id":"","url":"https://api.github.com/users/Aatch","html_url":"https://github.com/Aatch","followers_url":"https://api.github.com/users/Aatch/followers","following_url":"https://api.github.com/users/Aatch/following{/other_user}","gists_url":"https://api.github.com/users/Aatch/gists{/gist_id}","starred_url":"https://api.github.com/users/Aatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aatch/subscriptions","organizations_url":"https://api.github.com/users/Aatch/orgs","repos_url":"https://api.github.com/users/Aatch/repos","events_url":"https://api.github.com/users/Aatch/events{/privacy}","received_events_url":"https://api.github.com/users/Aatch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aatch/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/Aatch/rust","forks_url":"https://api.github.com/repos/Aatch/rust/forks","keys_url":"https://api.github.com/repos/Aatch/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aatch/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aatch/rust/teams","hooks_url":"https://api.github.com/repos/Aatch/rust/hooks","issue_events_url":"https://api.github.com/repos/Aatch/rust/issues/events{/number}","events_url":"https://api.github.com/repos/Aatch/rust/events","assignees_url":"https://api.github.com/repos/Aatch/rust/assignees{/user}","branches_url":"https://api.github.com/repos/Aatch/rust/branches{/branch}","tags_url":"https://api.github.com/repos/Aatch/rust/tags","blobs_url":"https://api.github.com/repos/Aatch/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aatch/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aatch/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aatch/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aatch/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/Aatch/rust/languages","stargazers_url":"https://api.github.com/repos/Aatch/rust/stargazers","contributors_url":"https://api.github.com/repos/Aatch/rust/contributors","subscribers_url":"https://api.github.com/repos/Aatch/rust/subscribers","subscription_url":"https://api.github.com/repos/Aatch/rust/subscription","commits_url":"https://api.github.com/repos/Aatch/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aatch/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aatch/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aatch/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aatch/rust/contents/{+path}","compare_url":"https://api.github.com/repos/Aatch/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aatch/rust/merges","archive_url":"https://api.github.com/repos/Aatch/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aatch/rust/downloads","issues_url":"https://api.github.com/repos/Aatch/rust/issues{/number}","pulls_url":"https://api.github.com/repos/Aatch/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/Aatch/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/Aatch/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aatch/rust/labels{/name}","releases_url":"https://api.github.com/repos/Aatch/rust/releases{/id}","deployments_url":"https://api.github.com/repos/Aatch/rust/deployments","created_at":"2012-11-29T05:04:07Z","updated_at":"2015-06-22T22:56:30Z","pushed_at":"2016-09-26T01:37:41Z","git_url":"git://github.com/Aatch/rust.git","ssh_url":"git@github.com:Aatch/rust.git","clone_url":"https://github.com/Aatch/rust.git","svn_url":"https://github.com/Aatch/rust","homepage":"http://www.rust-lang.org","size":302096,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":true,"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":1,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"05c2fdd64f3f4acc358b653616de6034eced49b5","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-09-27T12:16:15Z","pushed_at":"2016-09-27T11:05:35Z","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":516408,"stargazers_count":18422,"watchers_count":18422,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3556,"mirror_url":null,"open_issues_count":2830,"forks":3556,"open_issues":2830,"watchers":18422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36593"},"html":{"href":"https://github.com/rust-lang/rust/pull/36593"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/36593"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/36593/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36593/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/36593/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/76cc7cf058ad565349b5530425a3cac70551466f"}}}}
{"actor":{"display_login":"nikomatsakis"}}