{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/35900","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/35900/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/35900/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/35900/events","html_url":"https://github.com/rust-lang/rust/issues/35900","id":172498288,"number":35900,"title":"Tracking issue for \"Macros 1.1\" (RFC #1681)","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/B-RFC-approved","name":"B-RFC-approved","color":"e102d8"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/B-unstable","name":"B-unstable","color":"e102d8"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-lang","name":"T-lang","color":"bfd4f2"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-tools","name":"T-tools","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2016-08-22T16:37:11Z","updated_at":"2016-09-01T05:04:08Z","closed_at":null,"body":"Tracking issue for rust-lang/rfcs#1681.\r\n\r\ncc @alexcrichton \r\n\r\n## Implementation TODO\r\n\r\n* [ ] - Create a `rustc_macro` crate\r\n  * [ ] - Have `librustc_macro` link to `libsyntax`. Depend on `librustc_macro` in `librustc_driver`\r\n  * [ ] - Tag `rustc_macro` as unstable with our [standard header](https://github.com/rust-lang/rust/blob/master/src/libsyntax/lib.rs#L17-L25).\r\n  * [ ] - Only tag `rustc_macro` with `#![crate_type = \"rlib\"]`, do not produce a dylib.\r\n  * [ ] - Implement [the API](https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md#librustc_macro) of `rustc_macro` using `libsyntax`'s `TokenStream` internally\r\n  * [ ] - tag `rustc_macro` with a `TokenStream` lang item so the compiler knows about it.\r\n* [ ] - Add `rustc_macro_derive` attribute\r\n  * [ ] - validate it's of the exact form `foo(bar)`, no other arguments/formats\r\n  * [ ] - verify it's only applied to functions\r\n  * [ ] - verify it's only applied to functions in the root module\r\n  * [ ]  - verify the signature with the `TokenStream` lang item added above\r\n  * [ ] - encode all function symbols with `rustc_macro_derive` into metadata along with the derive mode they're used for.\r\n* [ ] - Add a `rustc-macro` crate type for other crates\r\n  * [ ] - wire it up to produce a dylib\r\n  * [ ] - ensure the dylib gets metadata\r\n  * [ ] - ensure `rustc-macro` crates **cannot be linked as dylibs**\r\n  * [ ] - ensure there are no *reachable* items other than those tagged with `#[rustc_macro_derive]`\r\n  * [ ] - Add `cfg(rustc_macro)` as an unstable `cfg` directive, set it for the `rustc-macro` crate type\r\n  * [ ] - ensure that `rustc-macro` crates link dynamically to libsytnax\r\n* [ ] - Fill in `#[macro_use]` support for `rustc-macro` crates\r\n  * [ ] - extend library loader to find `rustc-macro` crates separately from dylib/rlib tracked today when loding crates\r\n  * [ ] - Parse metadata for `rustc-macro` crates to learn about symbol/derive mode pairings\r\n  * [ ] - `dlopen` the dylib\r\n  * [ ] - generate an error if any derive mode would shadow any other.\r\n* [ ] - Add cargo integeration\r\n  * [ ] - recognize `rustc-macro` similar to `plugin = true`\r\n  * [ ] - pass `--crate-type=rustc-macro` when depending on it\r\n  * [ ] - plumb the same host/target logic for rustc-macro crates as is present for plugin crates (e.g. always compile rustc-macro crates for hosts)\r\n* [ ] - Tests\r\n  * [ ] - smoke test loading a rustc-macro, dummy `#[derive]` trait \r\n  * [ ] - name conflicts are an error\r\n  * [ ] - compiling for the wrong architecture is an error\r\n  * [ ] - cannot emit crate type rustc-macro and anything else (e.g. rustc-macro+dylib) is an error\r\n  * [ ] - span information not being horrendous\r\n  * [ ] - removing attributes from a struct, as well as fields\r\n  * [ ] - adding impls next to a struct\r\n  * [ ] - cross compilation looks for the host rustc-macro crate type\r\n  * [ ] - don't load vanilla dylibs as rustc-macro crate types\r\n  * [ ] - can't have public exports beyond macro derive functions in a rustc-macro crate\r\n  * [ ] - derive macros must have required signature\r\n  * [ ] - load two macro crates in one compilation\r\n\r\n## Stabilization TODO\r\n\r\n* Does serde work?\r\n* Does diesel work?\r\n* Agree on a name for the crate, this also affects the crate type, derive attribute name, and cargo manifest attribute name.\r\n* The `#[rustc_macro_derive]` attribute and its form.\r\n* Implementation of loading `rustc-macro` crates: `-L` to find them, `#[macro_use]` to load them, shadowing is an error, no hygiene, etc.\r\n* Cargo manifest attribute"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/243976887","html_url":"https://github.com/rust-lang/rust/issues/35900#issuecomment-243976887","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/35900","id":243976887,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars.githubusercontent.com/u/1055245?v=3","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T05:04:08Z","updated_at":"2016-09-01T05:04:08Z","body":"I left a comment on the cargo PR, but I think we want a different type of *dependency*, not just a different type of *package*. Firstly, I think this just is just better aestheticly and ergnomicly, but that's just my opinion. But I have two concrete reasons too.\r\n\r\n- In a future with public and private deps, it's important to know that its to know that public deps of procedural deps and regular public deps need not coincide. E.g.\r\n\r\n- In a future with inline procedural macros/quasi-quoting, any library can be used at compile time.\r\n\r\n- > will we want procedural macros' implementation functions to be able to call other procedural macros' implementation functions?\r\n\r\n As this shows the same crate could be a regular dep of another crate of procedural macros, or "}}
{"actor":{"display_login":"Ericson2314"}}