{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/7621","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/7621/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/7621/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/7621/events","html_url":"https://github.com/rust-lang/rust/issues/7621","id":16428375,"number":7621,"title":"Better error messages for type-errors due to #[deriving].","user":{"login":"huonw","id":1203825,"avatar_url":"https://avatars.githubusercontent.com/u/1203825?v=3","gravatar_id":"","url":"https://api.github.com/users/huonw","html_url":"https://github.com/huonw","followers_url":"https://api.github.com/users/huonw/followers","following_url":"https://api.github.com/users/huonw/following{/other_user}","gists_url":"https://api.github.com/users/huonw/gists{/gist_id}","starred_url":"https://api.github.com/users/huonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huonw/subscriptions","organizations_url":"https://api.github.com/users/huonw/orgs","repos_url":"https://api.github.com/users/huonw/repos","events_url":"https://api.github.com/users/huonw/events{/privacy}","received_events_url":"https://api.github.com/users/huonw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-diagnostics","name":"A-diagnostics","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-syntaxext","name":"A-syntaxext","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2013-07-06T08:14:26Z","updated_at":"2015-01-21T00:06:16Z","closed_at":null,"body":"`#[deriving(Trait)]` normally relies on the constituent types of the `struct` or `enum` also implement `Trait`, and currently, if they don't, the error messages are unclear. e.g. in the following code, the problem is `[f64, .. 3]` doesn't implement `Clone`.\r\n\r\n```rust\r\n#[deriving(Clone)]\r\nstruct V {\r\n    v : [f64, ..3]\r\n}\r\n\r\nfn main() {}\r\n```\r\n\r\n```\r\ntmp.rs:1:11: 1:16 error: mismatched types: expected `[f64, .. 3]` but found `&[f64, .. 3]` (expected vector but found &-ptr)\r\ntmp.rs:1 #[deriving(Clone)]\r\n```\r\n\r\n(This particular error message is because there is a `Clone` impl for `&T`, and that one is used if there is no `Clone` impl for `T`.)"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/70760599","html_url":"https://github.com/rust-lang/rust/issues/7621#issuecomment-70760599","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/7621","id":70760599,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T00:06:16Z","updated_at":"2015-01-21T00:06:16Z","body":"@huonw with https://github.com/rust-lang/rust/pull/11826 merged, is this fixed?"}}