{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/20477","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/20477/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/20477/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/20477/events","html_url":"https://github.com/rust-lang/rust/issues/20477","id":53308988,"number":20477,"title":"New orphan check makes it impossible to implement Hash<S>","user":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-03T16:55:11Z","updated_at":"2015-01-05T15:01:24Z","closed_at":null,"body":"```rust\r\n#![feature(default_type_params)]\r\nuse std::hash::{self, Hash};\r\n\r\nstruct Foo;\r\n\r\nimpl<S> Hash<S> for Foo where S: hash::Writer {\r\n    fn hash(&self, _: &mut S) {\r\n    }\r\n}\r\n\r\nfn main() {}\r\n```\r\n\r\n```\r\ntest.rs:6:1: 9:2 error: type parameter `S` must also appear as a type parameter of some type defined within this crate\r\ntest.rs:6 impl<S> Hash<S> for Foo where S: hash::Writer {\r\ntest.rs:7     fn hash(&self, _: &mut S) {\r\ntest.rs:8     }\r\ntest.rs:9 }\r\ntest.rs:6:1: 9:2 note: for a limited time, you can add `#![feature(old_orphan_check)]` to your crate to disable this rule\r\ntest.rs:6 impl<S> Hash<S> for Foo where S: hash::Writer {\r\ntest.rs:7     fn hash(&self, _: &mut S) {\r\ntest.rs:8     }\r\ntest.rs:9 }\r\nerror: aborting due to previous error\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/68718935","html_url":"https://github.com/rust-lang/rust/issues/20477#issuecomment-68718935","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/20477","id":68718935,"user":{"login":"reem","id":4745181,"avatar_url":"https://avatars.githubusercontent.com/u/4745181?v=3","gravatar_id":"","url":"https://api.github.com/users/reem","html_url":"https://github.com/reem","followers_url":"https://api.github.com/users/reem/followers","following_url":"https://api.github.com/users/reem/following{/other_user}","gists_url":"https://api.github.com/users/reem/gists{/gist_id}","starred_url":"https://api.github.com/users/reem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reem/subscriptions","organizations_url":"https://api.github.com/users/reem/orgs","repos_url":"https://api.github.com/users/reem/repos","events_url":"https://api.github.com/users/reem/events{/privacy}","received_events_url":"https://api.github.com/users/reem/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T15:01:24Z","updated_at":"2015-01-05T15:01:24Z","body":"Also can't write impls like:\r\n\r\n```rust\r\nimpl<E: Error> FromError<E> for Box<Error> {\r\n    fn from_error(e: E) -> Box<Error> {\r\n        box e \r\n    } \r\n}\r\n```\r\n\r\nwhich is a significant ergonomics hit for the use of `try!`. "}}