{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/235283671","pull_request_review_id":177112002,"id":235283671,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTI4MzY3MQ==","diff_hunk":"@@ -243,13 +243,35 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {\n             return;\n         }\n \n+        if self.tcx.features().const_let {\n+            let mut dest = dest;\n+            let index = loop {\n+                match dest {\n+                    // with `const_let` active, we treat all locals equal\n+                    Place::Local(index) => break *index,\n+                    // projections are transparent for assignments\n+                    // we qualify the entire destination at once, even if just a field would have\n+                    // stricter qualification\n+                    Place::Projection(proj) => dest = &proj.base,","path":"src/librustc_mir/transform/qualify_consts.rs","position":13,"original_position":13,"commit_id":"37fcd5cad5c314632aede576ae5fbbb1c3ede228","original_commit_id":"37fcd5cad5c314632aede576ae5fbbb1c3ede228","user":{"login":"eddyb","id":77424,"node_id":"MDQ6VXNlcjc3NDI0","avatar_url":"https://avatars2.githubusercontent.com/u/77424?v=4","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},"body":"The problem is something like this:\r\n```rust\r\nconst FOO: &(Cell<usize>, bool) = {\r\n    let mut a = (Cell::new(0), false);\r\n    a.1 = true; // resets `qualif(a)` to `qualif(true)`\r\n    &{a}\r\n};\r\n```\r\nI suspect that will actually compile with this PR, although I'd like a confirmation.\r\n\r\nWe could add this as a testcase, but you might be able to come up with something simpler/more general.","created_at":"2018-11-21T08:01:41Z","updated_at":"2018-11-21T08:01:41Z","html_url":"https://github.com/rust-lang/rust/pull/56070#discussion_r235283671","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/56070","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/235283671"},"html":{"href":"https://github.com/rust-lang/rust/pull/56070#discussion_r235283671"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56070"}},"in_reply_to_id":235278739},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/56070","id":231961587,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxOTYxNTg3","html_url":"https://github.com/rust-lang/rust/pull/56070","diff_url":"https://github.com/rust-lang/rust/pull/56070.diff","patch_url":"https://github.com/rust-lang/rust/pull/56070.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/56070","number":56070,"state":"open","locked":false,"title":"Allow assignments in const contexts","user":{"login":"oli-obk","id":332036,"node_id":"MDQ6VXNlcjMzMjAzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/332036?v=4","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"body":"fixes https://github.com/rust-lang/rust/issues/54098\r\nfixes https://github.com/rust-lang/rust/issues/51251\r\nfixes https://github.com/rust-lang/rust/issues/52613\r\n","created_at":"2018-11-19T12:49:35Z","updated_at":"2018-11-21T08:01:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0271d5aba9709cfc613a58ccbd5078e4fcb0f0d","assignee":{"login":"RalfJung","id":330628,"node_id":"MDQ6VXNlcjMzMDYyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/330628?v=4","gravatar_id":"","url":"https://api.github.com/users/RalfJung","html_url":"https://github.com/RalfJung","followers_url":"https://api.github.com/users/RalfJung/followers","following_url":"https://api.github.com/users/RalfJung/following{/other_user}","gists_url":"https://api.github.com/users/RalfJung/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfJung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfJung/subscriptions","organizations_url":"https://api.github.com/users/RalfJung/orgs","repos_url":"https://api.github.com/users/RalfJung/repos","events_url":"https://api.github.com/users/RalfJung/events{/privacy}","received_events_url":"https://api.github.com/users/RalfJung/received_events","type":"User","site_admin":false},"assignees":[{"login":"RalfJung","id":330628,"node_id":"MDQ6VXNlcjMzMDYyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/330628?v=4","gravatar_id":"","url":"https://api.github.com/users/RalfJung","html_url":"https://github.com/RalfJung","followers_url":"https://api.github.com/users/RalfJung/followers","following_url":"https://api.github.com/users/RalfJung/following{/other_user}","gists_url":"https://api.github.com/users/RalfJung/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfJung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfJung/subscriptions","organizations_url":"https://api.github.com/users/RalfJung/orgs","repos_url":"https://api.github.com/users/RalfJung/repos","events_url":"https://api.github.com/users/RalfJung/events{/privacy}","received_events_url":"https://api.github.com/users/RalfJung/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":583436937,"node_id":"MDU6TGFiZWw1ODM0MzY5Mzc=","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/56070/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/56070/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/56070/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/37fcd5cad5c314632aede576ae5fbbb1c3ede228","head":{"label":"oli-obk:const_let","ref":"const_let","sha":"37fcd5cad5c314632aede576ae5fbbb1c3ede228","user":{"login":"oli-obk","id":332036,"node_id":"MDQ6VXNlcjMzMjAzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/332036?v=4","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"repo":{"id":26541058,"node_id":"MDEwOlJlcG9zaXRvcnkyNjU0MTA1OA==","name":"rust","full_name":"oli-obk/rust","private":false,"owner":{"login":"oli-obk","id":332036,"node_id":"MDQ6VXNlcjMzMjAzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/332036?v=4","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/oli-obk/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/oli-obk/rust","forks_url":"https://api.github.com/repos/oli-obk/rust/forks","keys_url":"https://api.github.com/repos/oli-obk/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oli-obk/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oli-obk/rust/teams","hooks_url":"https://api.github.com/repos/oli-obk/rust/hooks","issue_events_url":"https://api.github.com/repos/oli-obk/rust/issues/events{/number}","events_url":"https://api.github.com/repos/oli-obk/rust/events","assignees_url":"https://api.github.com/repos/oli-obk/rust/assignees{/user}","branches_url":"https://api.github.com/repos/oli-obk/rust/branches{/branch}","tags_url":"https://api.github.com/repos/oli-obk/rust/tags","blobs_url":"https://api.github.com/repos/oli-obk/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oli-obk/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oli-obk/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/oli-obk/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oli-obk/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/oli-obk/rust/languages","stargazers_url":"https://api.github.com/repos/oli-obk/rust/stargazers","contributors_url":"https://api.github.com/repos/oli-obk/rust/contributors","subscribers_url":"https://api.github.com/repos/oli-obk/rust/subscribers","subscription_url":"https://api.github.com/repos/oli-obk/rust/subscription","commits_url":"https://api.github.com/repos/oli-obk/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/oli-obk/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/oli-obk/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/oli-obk/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/oli-obk/rust/contents/{+path}","compare_url":"https://api.github.com/repos/oli-obk/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oli-obk/rust/merges","archive_url":"https://api.github.com/repos/oli-obk/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oli-obk/rust/downloads","issues_url":"https://api.github.com/repos/oli-obk/rust/issues{/number}","pulls_url":"https://api.github.com/repos/oli-obk/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/oli-obk/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/oli-obk/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oli-obk/rust/labels{/name}","releases_url":"https://api.github.com/repos/oli-obk/rust/releases{/id}","deployments_url":"https://api.github.com/repos/oli-obk/rust/deployments","created_at":"2014-11-12T15:00:39Z","updated_at":"2018-05-19T18:03:34Z","pushed_at":"2018-11-20T11:29:12Z","git_url":"git://github.com/oli-obk/rust.git","ssh_url":"git@github.com:oli-obk/rust.git","clone_url":"https://github.com/oli-obk/rust.git","svn_url":"https://github.com/oli-obk/rust","homepage":"http://www.rust-lang.org","size":403894,"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":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"7e82eda000c8d4abbdaa76b3563cd77f938fc411","user":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ3MTI=","name":"rust","full_name":"rust-lang/rust","private":false,"owner":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","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},"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-11-21T07:58:27Z","pushed_at":"2018-11-21T07:39:38Z","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":404788,"stargazers_count":31891,"watchers_count":31891,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5311,"mirror_url":null,"archived":false,"open_issues_count":4577,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5311,"open_issues":4577,"watchers":31891,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56070"},"html":{"href":"https://github.com/rust-lang/rust/pull/56070"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/56070"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/56070/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/56070/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/56070/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/37fcd5cad5c314632aede576ae5fbbb1c3ede228"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"eddyb"}}