{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/2020","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/2020/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/2020/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/2020/events","html_url":"https://github.com/rust-lang/cargo/issues/2020","id":109620748,"number":2020,"title":" Cargo doesn’t expand macros properly when generating docs","user":{"login":"photino","id":3446306,"avatar_url":"https://avatars.githubusercontent.com/u/3446306?v=3","gravatar_id":"","url":"https://api.github.com/users/photino","html_url":"https://github.com/photino","followers_url":"https://api.github.com/users/photino/followers","following_url":"https://api.github.com/users/photino/following{/other_user}","gists_url":"https://api.github.com/users/photino/gists{/gist_id}","starred_url":"https://api.github.com/users/photino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/photino/subscriptions","organizations_url":"https://api.github.com/users/photino/orgs","repos_url":"https://api.github.com/users/photino/repos","events_url":"https://api.github.com/users/photino/events{/privacy}","received_events_url":"https://api.github.com/users/photino/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-03T12:26:37Z","updated_at":"2015-10-04T18:44:49Z","closed_at":"2015-10-04T18:44:49Z","body":"I have defined a macro to bind constants:\r\n\r\n```rust\r\n#[derive(Copy, Clone, Debug, Eq, PartialEq)]\r\npub struct Const(pub i32);\r\n\r\nmacro_rules! bind_constant {\r\n    ($NAME:ident, $value:expr) => {\r\n        pub const $NAME: Const = Const($value);\r\n    }\r\n}\r\n\r\nbind_constant!(A, 10i32);\r\nbind_constant!(B, 20i32);\r\n\r\n#[test]\r\n#[should_panic]\r\nfn test_consts() {\r\n    assert_eq!(A, B);\r\n}\r\n```\r\n\r\nWhen I use Cargo to generate docs, it fails to expand the macro properly:\r\n```rust\r\npub const A: Const = Const($value)\r\n```"}}