{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/37167","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/37167/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/37167/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/37167/events","html_url":"https://github.com/rust-lang/rust/pull/37167","id":183066506,"number":37167,"title":"detect extra region requirements in impls","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},"labels":[{"id":223796632,"url":"https://api.github.com/repos/rust-lang/rust/labels/relnotes","name":"relnotes","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"assignees":[{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false}],"milestone":null,"comments":18,"created_at":"2016-10-14T14:36:24Z","updated_at":"2016-11-02T22:14:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/37167","html_url":"https://github.com/rust-lang/rust/pull/37167","diff_url":"https://github.com/rust-lang/rust/pull/37167.diff","patch_url":"https://github.com/rust-lang/rust/pull/37167.patch"},"body":"The current \"compare method\" check fails to check for the \"region obligations\" that accrue in the fulfillment context. This branch switches that code to create a `FnCtxt` so that it can invoke the regionck code. Previous crater runs (I haven't done one with the latest tip) have found some small number of affected crates, so I went ahead and introduced a warning cycle. I will kick off a crater run with this branch shortly.\n\nThis is a [breaking-change] because previously unsound code was accepted. The crater runs also revealed some cases where legitimate code was no longer type-checking, so the branch contains one additional (but orthogonal) change. It improves the elaborator so that we elaborate region requirements more thoroughly. In particular, if we know that `&'a T: 'b`, we now deduce that `T: 'b` and `'a: 'b`. \n\nI invested a certain amount of effort in getting a good error message. The error message looks like this:\n\n```\nerror[E0276]: impl has stricter requirements than trait\n  --> traits-elaborate-projection-region.rs:33:5\n   |\n21 |     fn foo() where T: 'a;\n   |     --------------------- definition of `foo` from trait\n...\n33 |     fn foo() where U: 'a { }\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a`\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #18937 <https://github.com/rust-lang/rust/issues/18937>\nnote: lint level defined here\n  --> traits-elaborate-projection-region.rs:12:9\n   |\n12 | #![deny(extra_requirement_in_impl)]\n   |         ^^^^^^^^^^^^^^^^^^^^^^^^^\n```\n\nObviously the warning only prints if this is a _new_ error (that resulted from the bugfix). But all existing errors that fit this description are updated to follow the general template. In order to get the lint to preserve the span-labels and the error code, I separate out the core `Diagnostic` type (which encapsulates the error code, message, span, and children) from the `DiagnosticBuilder` (which layers on a `Handler` that can be used to report errors). I also extended `add_lint` with an alternative `add_lint_diagnostic` that takes in a full diagnostic (cc @jonathandturner for those changes). This doesn't feel ideal but feels like it's moving in the right direction =).\n\nr? @pnkfelix \ncc @arielb1 \n\nFixes #18937 \n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/258015827","html_url":"https://github.com/rust-lang/rust/pull/37167#issuecomment-258015827","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37167","id":258015827,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T22:14:10Z","updated_at":"2016-11-02T22:14:10Z","body":"@bors: retry\n\nOn Wed, Nov 2, 2016 at 2:29 PM, bors <notifications@github.com> wrote:\n\n> 💔 Test failed - auto-win-msvc-64-opt\n> <https://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt/builds/6019>\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/rust-lang/rust/pull/37167#issuecomment-258004871>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AAD95JkosIh2Zniw1f3JH0wAWSQdu0Maks5q6QC9gaJpZM4KXFF2>\n> .\n>\n"}}
{"actor":{"display_login":"alexcrichton"}}