{"action":"created","issue":{"url":"https://api.github.com/repos/diesel-rs/diesel/issues/1521","repository_url":"https://api.github.com/repos/diesel-rs/diesel","labels_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1521/labels{/name}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1521/comments","events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1521/events","html_url":"https://github.com/diesel-rs/diesel/pull/1521","id":293665032,"number":1521,"title":"Get diesel_derives2 working with hygiene turned on","user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars2.githubusercontent.com/u/1529387?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-01T20:03:05Z","updated_at":"2018-02-01T22:22:26Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/diesel-rs/diesel/pulls/1521","html_url":"https://github.com/diesel-rs/diesel/pull/1521","diff_url":"https://github.com/diesel-rs/diesel/pull/1521.diff","patch_url":"https://github.com/diesel-rs/diesel/pull/1521.patch"},"body":"When `proc_macro2` has the nightly feature enabled, a lot of the rules\r\naround hygiene change. Most of the changes needed appear to be due to\r\nbugs in Rust (e.g. to access a tuple struct field, the span of the dot has to\r\nbe resolved specially, but not for a named struct field), but the span\r\nchanges for table names in particular is definitely required.\r\n\r\nThe change to hygiene rules randomly broke our const workaround (the\r\nability to `use` items defined in an expression like that was\r\npotentially unintended to begin with). However, there's no reason it\r\nneeds to be a const, we can just have it be a module with no additional\r\nproblems.\r\n\r\nI've added a few UI tests for the failure cases that are actually\r\naffected by this change (there is more work to be done on this, of\r\ncourse). Note that we can't actually run those tests yet, as they\r\nrequire a nightly compiler, and we won't build on nightly until\r\ntomorrow. However, I've left the tests in place so that the changes in\r\noutput can be seen.\r\n\r\nThe error for `table_name` isn't quite there, but due to a bug in Rust\r\nit's the best we can do. Right now it looks like this:\r\n\r\n```\r\n1 | #[table_name = \"users\"]\r\n  | ^ Use of undeclared type or module `users`\r\n```\r\n\r\ninstead of like this:\r\n\r\n```\r\n1 | #[table_name = \"users\"]\r\n  |                ^^^^^^^ Use of undeclared type or module `users`\r\n```"},"comment":{"url":"https://api.github.com/repos/diesel-rs/diesel/issues/comments/362421994","html_url":"https://github.com/diesel-rs/diesel/pull/1521#issuecomment-362421994","issue_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1521","id":362421994,"user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars2.githubusercontent.com/u/1529387?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T22:22:26Z","updated_at":"2018-02-01T22:22:26Z","author_association":"OWNER","body":"https://github.com/rust-lang/rust/pull/47738 will be in tomorrow's nightly."}}
{"actor":{"display_login":"sgrif"}}