{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1464","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1464/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1464/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1464/events","html_url":"https://github.com/rust-lang/rfcs/issues/1464","id":126876238,"number":1464,"title":"macro future proofing: extend analysis to detect unfortunate interaction across arms","user":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-15T13:52:08Z","updated_at":"2016-03-24T22:51:00Z","closed_at":null,"body":"spawned off of https://github.com/rust-lang/rust/issues/30531#issuecomment-170080470\r\n\r\n(transcribed relevant material from that comment below.)\r\n\r\n> when we released 1.0, we set some parameters for what sorts of changes we could make to the Rust grammar. In particular, for things like expressions and types, which can be referenced from macro definitions, we established (in [RFC 550]) a set of [legal \"follow\" tokens](https://github.com/rust-lang/rfcs/blob/master/text/0550-macro-future-proofing.md#follownt) that must never be added to the grammar. For example, the follow set for an expression was defined as `=>`, `,`, and `;`. These sets were derived by looking at the existing Rust grammar and finding expression terminators we were already committed to: for example, expressions can already be followed by `,` in a tuple expression or function call. **Under those rules, the change to implement type ascription is legal.**\r\n> \r\n> [RFC 550] also defined a static analysis that was intended to reject macro definitions which might be affected by (legal) changes to the expression grammar. For example, that analysis would reject a macro arm such as `$e:expr : $t:ty` because, there, `$e` is followed by `:`, which is not in the follow set for an expression. This means that if we were to add something like type ascription, the macro would break, and we did not want that to happen. However, as this issue demonstrates, that static anlysis contains a \"soundness bug\" when it comes to multiple macro arms.\r\n> \r\n> In the medium to long term, we need to patch [RFC 550] to correctly account for multiple macro arms. In the short term, however, macro authors will have to look at their own macros to check whether they might be broken by changes to the extension grammar. \r\n\r\n[RFC 550]: https://github.com/rust-lang/rfcs/blob/master/text/0550-macro-future-proofing.md"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/201063512","html_url":"https://github.com/rust-lang/rfcs/issues/1464#issuecomment-201063512","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1464","id":201063512,"user":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T22:51:00Z","updated_at":"2016-03-24T22:51:00Z","body":"cc #1384 "}}