{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/31383","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/31383/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/31383/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/31383/events","html_url":"https://github.com/rust-lang/rust/issues/31383","id":130982579,"number":31383,"title":"concat doesn't allow string constants as parameters","user":{"login":"CodeMonkey90","id":877258,"avatar_url":"https://avatars.githubusercontent.com/u/877258?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMonkey90","html_url":"https://github.com/CodeMonkey90","followers_url":"https://api.github.com/users/CodeMonkey90/followers","following_url":"https://api.github.com/users/CodeMonkey90/following{/other_user}","gists_url":"https://api.github.com/users/CodeMonkey90/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMonkey90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMonkey90/subscriptions","organizations_url":"https://api.github.com/users/CodeMonkey90/orgs","repos_url":"https://api.github.com/users/CodeMonkey90/repos","events_url":"https://api.github.com/users/CodeMonkey90/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMonkey90/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-02-03T10:25:43Z","updated_at":"2016-07-25T21:01:50Z","closed_at":"2016-07-25T21:01:50Z","body":"Scenario: I've defined a description and a version constant:\r\n\r\n```rust\r\nconst DESCRIPTION: &'static str = \"my program\";\r\nconst VERSION: &'static str = env!(\"CARGO_PKG_VERSION\");\r\n```\r\n\r\nNow I want to define a version string which I'll print when the -v argument is passed:\r\n\r\n```rust\r\nconst VERSION_STRING: &'static str = concat!(DESCRIPTION, \" v\", VERSION);\r\n```\r\n\r\nThis currently does not work, which is not intuitive. I'd expect static constants to work just like string literals. If you want to concatenate string constants to form another string constant, you currently have to define a macro for each constant:\r\n\r\n```rust\r\nmacro_rules! description {\r\n    () => ( \"my program\" )\r\n}\r\nmacro_rules! version {\r\n    () => ( env!(\"CARGO_PKG_VERSION\") )\r\n}\r\nmacro_rules! version_string {\r\n    () => ( concat!(description!(), \" v\", version!()) )\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/235083996","html_url":"https://github.com/rust-lang/rust/issues/31383#issuecomment-235083996","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/31383","id":235083996,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T21:01:50Z","updated_at":"2016-07-25T21:01:50Z","body":"Closing as \"not a bug\"."}}
{"actor":{"display_login":"steveklabnik"}}