{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/19853","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/19853/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/19853/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/19853/events","html_url":"https://github.com/rust-lang/rust/issues/19853","id":51937661,"number":19853,"title":"Unable to infer type information despite enough context.","user":{"login":"aatxe","id":744293,"avatar_url":"https://avatars.githubusercontent.com/u/744293?v=3","gravatar_id":"","url":"https://api.github.com/users/aatxe","html_url":"https://github.com/aatxe","followers_url":"https://api.github.com/users/aatxe/followers","following_url":"https://api.github.com/users/aatxe/following{/other_user}","gists_url":"https://api.github.com/users/aatxe/gists{/gist_id}","starred_url":"https://api.github.com/users/aatxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aatxe/subscriptions","organizations_url":"https://api.github.com/users/aatxe/orgs","repos_url":"https://api.github.com/users/aatxe/repos","events_url":"https://api.github.com/users/aatxe/events{/privacy}","received_events_url":"https://api.github.com/users/aatxe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-typesystem","name":"A-typesystem","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2014-12-15T00:08:52Z","updated_at":"2015-04-24T06:49:44Z","closed_at":"2015-04-24T06:49:44Z","body":"So, I have the following code, and it no longer compiles after a recent nightly. This issue appears to be inference-related. This is the error I'm suddenly getting:\r\n\r\n```\r\nmarkov/src/lib.rs:78:13: 78:27 error: unable to infer enough type information to locate the impl of the trait `core::cmp::Eq` for the type `_`; type annotations required\r\nmarkov/src/lib.rs:78             self.map[p[0]].add(p[1].clone());\r\n                                 ^~~~~~~~~~~~~~\r\n```\r\n\r\nHere's the code, the line with *** is the one that does not compile.:\r\n```rust\r\nimpl<T: Eq + Hash> Chain<T> {\r\n    // ...\r\n    pub fn feed(&mut self, tokens: Vec<T>) -> &mut Chain<T> {\r\n        if tokens.len() == 0 { return self }\r\n        let mut toks = Vec::new();\r\n        toks.push(self.start.clone());\r\n        toks.extend(tokens.into_iter().map(|token| {\r\n            let rc = Rc::new(token);\r\n            if !self.map.contains_key(&rc) {\r\n                self.map.insert(rc.clone(), HashMap::new());\r\n            }\r\n            rc\r\n        }));\r\n        toks.push(self.end.clone());\r\n        for p in toks.windows(2) {\r\n            self.map[p[0]].add(p[1].clone()); // *** does not compile\r\n        }\r\n        self\r\n    }\r\n    // ...\r\n}\r\n\r\nimpl<T: Eq + Hash> States<T> for HashMap<Rc<T>, uint> {\r\n    fn add(&mut self, token: Rc<T>) {\r\n        match self.entry(token) {\r\n            Occupied(mut e) => *e.get_mut() += 1,\r\n            Vacant(e) => { e.set(1); },\r\n        }\r\n    }\r\n    // ...\r\n}\r\n```\r\n\r\nIf more context is needed, the full code can be seen [here](https://github.com/aaronweiss74/markov/blob/a81a3fe45deac9d9a92142a494881a83c94315d8/src/lib.rs)."}}