{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22286","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22286/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22286/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22286/events","html_url":"https://github.com/rust-lang/rust/pull/22286","id":57633857,"number":22286,"title":"Implement variance RFC #738 ","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":[],"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},"milestone":null,"comments":7,"created_at":"2015-02-13T18:13:57Z","updated_at":"2015-02-18T23:50:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/22286","html_url":"https://github.com/rust-lang/rust/pull/22286","diff_url":"https://github.com/rust-lang/rust/pull/22286.diff","patch_url":"https://github.com/rust-lang/rust/pull/22286.patch"},"body":"This PR:\r\n* converts the markers to the new `PhantomData`/`PhantomFn` scheme;\r\n* corrects various errors in variance inference, which was not always taking the correct things into account;\r\n* integrates results variance into trait matching, coherence, subtyping.\r\n\r\nThis is a [breaking-change]:\r\n\r\n* The old markers are removed in favor of `PhantomData`. It is possible to simulate all of the old markers:\r\n    - `ContravariantLifetime<'a>` -> `PhantomData<&'a ()>` (or just `&'a ()`, actually)\r\n    - `InvariantLifetime<'a>` -> `PhantomData<Cell<&'a ()>>`\r\n    - `CovariantType<T>` -> `PhantomData<T>`\r\n    - `ContravariantType<T>` -> `PhantomData<fn(T)>`\r\n    - `InvariantType<T>` -> `PhantomData<Cell<T>>`\r\n* It is now illegal to have unused type and lifetime parameters. Typically the best fix is either to remove the parameter or to add an instance of `PhantomData` to your struct (or `PhantomFn` / `MarkerTrait` to your trait). See rust-lang/rfcs#738 for more background.\r\n* Technically, variance can cause some impls that used to be legal to be illegal due to subtyping. This is highly unlikely to affect you.\r\n\r\nFixes #22212."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/74974175","html_url":"https://github.com/rust-lang/rust/pull/22286#issuecomment-74974175","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22286","id":74974175,"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":"2015-02-18T23:50:03Z","updated_at":"2015-02-18T23:50:03Z","body":"@bors: r=pnkfelix 9f8b9d6"}}