{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/79966190","id":79966190,"diff_hunk":"@@ -29,18 +29,34 @@\n //! (non-mutating) use of `SRC`. These restrictions are conservative and may be relaxed in the\n //! future.\n \n-use def_use::DefUseAnalysis;\n-use rustc::mir::repr::{Local, Lvalue, Mir, Operand, Rvalue, StatementKind};\n+use def_use::{DefUseAnalysis, MirSummary};\n+use rustc::mir::repr::{Constant, Local, Location, Lvalue, Mir, Operand, Rvalue, StatementKind};\n use rustc::mir::transform::{MirPass, MirSource, Pass};\n+use rustc::mir::visit::MutVisitor;\n use rustc::ty::TyCtxt;\n use rustc_data_structures::indexed_vec::Idx;\n+use transform::qualify_consts;\n \n pub struct CopyPropagation;\n \n impl Pass for CopyPropagation {}\n \n impl<'tcx> MirPass<'tcx> for CopyPropagation {\n-    fn run_pass<'a>(&mut self, _: TyCtxt<'a, 'tcx, 'tcx>, _: MirSource, mir: &mut Mir<'tcx>) {\n+    fn run_pass<'a>(&mut self,\n+                    tcx: TyCtxt<'a, 'tcx, 'tcx>,\n+                    source: MirSource,\n+                    mir: &mut Mir<'tcx>) {\n+        match source {\n+            MirSource::Const(_) | MirSource::Static(..) | MirSource::Promoted(..) => return,\n+            MirSource::Fn(function_node_id) => {\n+                // Don't run on const functions, because constant qualification might reject the\n+                // optimized IR.","path":"src/librustc_mir/transform/copy_prop.rs","position":28,"original_position":28,"commit_id":"04598c0781ab62836a6cd27f9f73d1433b544f72","original_commit_id":"04598c0781ab62836a6cd27f9f73d1433b544f72","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"body":"@eddyb But when I tried to bootstrap without doing this then `qualify_consts` started emitting errors. So I think it is a problem with that pass, no?","created_at":"2016-09-22T01:43:22Z","updated_at":"2016-09-22T01:43:23Z","html_url":"https://github.com/rust-lang/rust/pull/36639#discussion_r79966190","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/36639","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/79966190"},"html":{"href":"https://github.com/rust-lang/rust/pull/36639#discussion_r79966190"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36639"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/36639","id":86264374,"html_url":"https://github.com/rust-lang/rust/pull/36639","diff_url":"https://github.com/rust-lang/rust/pull/36639.diff","patch_url":"https://github.com/rust-lang/rust/pull/36639.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/36639","number":36639,"state":"open","locked":false,"title":"librustc_mir: Propagate constants during copy propagation.","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"body":"This optimization kicks in a lot when bootstrapping the compiler.\r\n\r\nr? @eddyb","created_at":"2016-09-22T00:32:16Z","updated_at":"2016-09-22T01:43:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f472356b9aae07e85b1da8e8bc2dae5f03c497b","assignee":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"assignees":[{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/36639/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/36639/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/36639/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/04598c0781ab62836a6cd27f9f73d1433b544f72","head":{"label":"pcwalton:const-prop","ref":"const-prop","sha":"04598c0781ab62836a6cd27f9f73d1433b544f72","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"repo":{"id":771652,"name":"rust","full_name":"pcwalton/rust","owner":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pcwalton/rust","description":"A work-in-progress programming language; not yet suitable for users","fork":true,"url":"https://api.github.com/repos/pcwalton/rust","forks_url":"https://api.github.com/repos/pcwalton/rust/forks","keys_url":"https://api.github.com/repos/pcwalton/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pcwalton/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pcwalton/rust/teams","hooks_url":"https://api.github.com/repos/pcwalton/rust/hooks","issue_events_url":"https://api.github.com/repos/pcwalton/rust/issues/events{/number}","events_url":"https://api.github.com/repos/pcwalton/rust/events","assignees_url":"https://api.github.com/repos/pcwalton/rust/assignees{/user}","branches_url":"https://api.github.com/repos/pcwalton/rust/branches{/branch}","tags_url":"https://api.github.com/repos/pcwalton/rust/tags","blobs_url":"https://api.github.com/repos/pcwalton/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pcwalton/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pcwalton/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/pcwalton/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pcwalton/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/pcwalton/rust/languages","stargazers_url":"https://api.github.com/repos/pcwalton/rust/stargazers","contributors_url":"https://api.github.com/repos/pcwalton/rust/contributors","subscribers_url":"https://api.github.com/repos/pcwalton/rust/subscribers","subscription_url":"https://api.github.com/repos/pcwalton/rust/subscription","commits_url":"https://api.github.com/repos/pcwalton/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/pcwalton/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/pcwalton/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/pcwalton/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/pcwalton/rust/contents/{+path}","compare_url":"https://api.github.com/repos/pcwalton/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pcwalton/rust/merges","archive_url":"https://api.github.com/repos/pcwalton/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pcwalton/rust/downloads","issues_url":"https://api.github.com/repos/pcwalton/rust/issues{/number}","pulls_url":"https://api.github.com/repos/pcwalton/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/pcwalton/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/pcwalton/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pcwalton/rust/labels{/name}","releases_url":"https://api.github.com/repos/pcwalton/rust/releases{/id}","deployments_url":"https://api.github.com/repos/pcwalton/rust/deployments","created_at":"2010-07-13T02:33:24Z","updated_at":"2014-07-24T06:42:55Z","pushed_at":"2016-09-22T00:32:05Z","git_url":"git://github.com/pcwalton/rust.git","ssh_url":"git@github.com:pcwalton/rust.git","clone_url":"https://github.com/pcwalton/rust.git","svn_url":"https://github.com/pcwalton/rust","homepage":"","size":303667,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"53f97302910bdfd9080648991d31b000a21d877d","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-22T00:02:43Z","pushed_at":"2016-09-22T00:35:03Z","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":511198,"stargazers_count":18369,"watchers_count":18369,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3544,"mirror_url":null,"open_issues_count":2826,"forks":3544,"open_issues":2826,"watchers":18369,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36639"},"html":{"href":"https://github.com/rust-lang/rust/pull/36639"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/36639"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/36639/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/36639/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/36639/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/04598c0781ab62836a6cd27f9f73d1433b544f72"}}}}
{"actor":{"display_login":"pcwalton"}}