{"action":"created","issue":{"url":"https://api.github.com/repos/hyperium/hyper/issues/275","labels_url":"https://api.github.com/repos/hyperium/hyper/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/hyperium/hyper/issues/275/comments","events_url":"https://api.github.com/repos/hyperium/hyper/issues/275/events","html_url":"https://github.com/hyperium/hyper/issues/275","id":55498361,"number":275,"title":"Show other possible implementations in the \"trait not implemented\" message","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-26T15:52:12Z","updated_at":"2015-01-26T15:53:00Z","closed_at":"2015-01-26T15:53:00Z","body":"Currently, if I try to index a `[T]` by a `u8` (`buf[1u8]`, or whatever), I'll get the error\r\n\r\n```\r\ntest.rs:6:15: 6:19 error: the trait `core::ops::Index<u8>` is not implemented for the type `[u8]` [E0277]\r\ntest.rs:6 println!(\"{}\",y[x])\r\n```\r\n\r\nIt would be helpful in such a situation for a note saying that there _is_ an implementation of `Index<usize>`.\r\n\r\nBasically: If a trait isn't found to be implemented, but a version of that trait with different type parameters is, show  some `help` messages containing the candidates. We do something like this already when one tries to call a nonexistent method on a type where bringing some trait into scope might make it work.\r\n\r\nIn this case, it should show something along the lines of:\r\n\r\n```\r\ntest.rs:7:22: 7:22 help: the following implementations were found:\r\ntest.rs:7:22: 7:22 help: implementation #1: `Index<usize>`\r\n``"},"comment":{"url":"https://api.github.com/repos/hyperium/hyper/issues/comments/71482349","html_url":"https://github.com/hyperium/hyper/issues/275#issuecomment-71482349","issue_url":"https://api.github.com/repos/hyperium/hyper/issues/275","id":71482349,"user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T15:52:59Z","updated_at":"2015-01-26T15:52:59Z","body":"oops. wrong repo, this is what I get for having too many tabs open."}}