{"action":"opened","issue":{"url":"https://api.github.com/repos/dtolnay/syn/issues/70","repository_url":"https://api.github.com/repos/dtolnay/syn","labels_url":"https://api.github.com/repos/dtolnay/syn/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/dtolnay/syn/issues/70/comments","events_url":"https://api.github.com/repos/dtolnay/syn/issues/70/events","html_url":"https://github.com/dtolnay/syn/issues/70","id":197218010,"number":70,"title":"Askama","user":{"login":"dtolnay","id":1940490,"avatar_url":"https://avatars.githubusercontent.com/u/1940490?v=3","gravatar_id":"","url":"https://api.github.com/users/dtolnay","html_url":"https://github.com/dtolnay","followers_url":"https://api.github.com/users/dtolnay/followers","following_url":"https://api.github.com/users/dtolnay/following{/other_user}","gists_url":"https://api.github.com/users/dtolnay/gists{/gist_id}","starred_url":"https://api.github.com/users/dtolnay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtolnay/subscriptions","organizations_url":"https://api.github.com/users/dtolnay/orgs","repos_url":"https://api.github.com/users/dtolnay/repos","events_url":"https://api.github.com/users/dtolnay/events{/privacy}","received_events_url":"https://api.github.com/users/dtolnay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-22T16:53:25Z","updated_at":"2016-12-22T16:53:25Z","closed_at":null,"body":"From IRC:\r\n\r\n> **\\<djc>** I'm trying to build a little proof of concept using macros 1.1, with syn\r\n> **\\<djc>** but so far, having some problems getting it to run\r\n> **\\<djc>** anyone has experience with this stuff?\r\n> **\\<djc>** this is what I have so far: http://dpaste.com/2RDDN2Y\r\n\r\n@djc did you get this figured out? I see some new commits in https://github.com/djc/askama but want to make sure you aren't still stuck.\r\n\r\nMacros 1.1 has a restriction that a proc macro defined in a crate cannot be used in that same crate, so that is probably where this went wrong.\r\n\r\n```rust\r\n#![feature(proc_macro, proc_macro_lib)]\r\n\r\nextern crate proc_macro;\r\nuse proc_macro::TokenStream;\r\n\r\nmacro_rules! A {\r\n    () => { struct A; }\r\n}\r\n\r\n#[proc_macro_derive(B)]\r\npub fn b(input: TokenStream) -> TokenStream {\r\n    \"struct B;\".parse().unwrap()\r\n}\r\n\r\n#[test]\r\nfn it_works() {\r\n    A!(); // can use this macro\r\n    let _: A;\r\n\r\n    #[derive(B)] // cannot use this proc macro\r\n    struct Dummy;\r\n    let _: B;\r\n}\r\n```\r\n\r\nI see that you made a separate askama_test crate so hopefully that works better. Another option is what [serde_derive](https://github.com/serde-rs/serde/tree/master/serde_derive) does which is keep tests in a `tests` subdirectory."}}
{"actor":{"display_login":"dtolnay"}}