{"action":"closed","issue":{"url":"https://api.github.com/repos/brson/error-chain/issues/38","repository_url":"https://api.github.com/repos/brson/error-chain","labels_url":"https://api.github.com/repos/brson/error-chain/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/brson/error-chain/issues/38/comments","events_url":"https://api.github.com/repos/brson/error-chain/issues/38/events","html_url":"https://github.com/brson/error-chain/issues/38","id":176348014,"number":38,"title":"Problems with foreign_links","user":{"login":"golddranks","id":2675542,"avatar_url":"https://avatars.githubusercontent.com/u/2675542?v=3","gravatar_id":"","url":"https://api.github.com/users/golddranks","html_url":"https://github.com/golddranks","followers_url":"https://api.github.com/users/golddranks/followers","following_url":"https://api.github.com/users/golddranks/following{/other_user}","gists_url":"https://api.github.com/users/golddranks/gists{/gist_id}","starred_url":"https://api.github.com/users/golddranks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golddranks/subscriptions","organizations_url":"https://api.github.com/users/golddranks/orgs","repos_url":"https://api.github.com/users/golddranks/repos","events_url":"https://api.github.com/users/golddranks/events{/privacy}","received_events_url":"https://api.github.com/users/golddranks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-12T10:59:24Z","updated_at":"2016-11-14T22:18:36Z","closed_at":"2016-11-14T22:18:36Z","body":"First of all, it seems that the order of the blocks in error_chain! { } matters (placing foreign_links after errors made it break). This feels different from the general top-level declarations in Rust so I was surprised. Can the macro be made flexible about the order of the declarations?\n\nSecondly, and more importantly, I'm still unable to get it work :( I have code like this:\n\n```\npub mod errors {\n    error_chain! {\n        foreign_links {\n            diesel::result::Error, DieselError;\n        }\n        errors {\n            NoSuchUser(email: String) {\n                description(\"No such user exists\")\n                display(\"No user with e-mail address {} exists.\", email)\n            }\n            EmailAddressTooLong {\n                description(\"E-mail address too long\")\n                display(\"A valid e-mail address can be 254 characters at maximum.\")\n            }\n            AuthError {\n                description(\"Can't authenticate user\")\n                display(\"Username (= e-mail) or password doesn't match.\")\n            }\n        }\n    }\n}\n\nuse errors::*;\n```\n\nThe foreign links section breaks:\n\n```\nerror[E0433]: failed to resolve. Use of undeclared type or module `diesel::result`\n  --> src/lib.rs:29:13\n   |\n29 |             diesel::result::Error, DieselError;\n   |             ^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `diesel::result`\n<error_chain macros>:119:1: 124:37 note: in this expansion of error_chain! (defined in <error_chain macros>)\n<error_chain macros>:133:1: 138:37 note: in this expansion of error_chain! (defined in <error_chain macros>)\nsrc/lib.rs:27:5: 61:6 note: in this expansion of error_chain! (defined in <error_chain macros>)\n```\n\nBut I have `extern crate diesel;` in place, so fully qualified paths starting with `diesel` should work, right? And trying to address the error message with `use diesel::result;` or `use diesel::result::Error;` doesn't help. What to do?\n"}}
{"actor":{"display_login":"Yamakaky"}}