{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/673","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/673/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/673/events","html_url":"https://github.com/rust-lang/rfcs/issues/673","id":55069698,"number":673,"title":"Variable labeling of complex match arms should be able to label the whole arm","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-21T20:04:28Z","updated_at":"2015-01-21T20:04:28Z","closed_at":null,"body":"<a href=\"https://github.com/Manishearth\"><img src=\"https://avatars.githubusercontent.com/u/1617736?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [Manishearth](https://github.com/Manishearth)**\n_Friday Jun 27, 2014 at 17:41 GMT_\n\n_For earlier discussion, see https://github.com/rust-lang/rust/issues/15219_\n\n_This issue was labelled with: B-RFC, I-papercut in the Rust repository_\n\n----\n\nIf I have a match arm like this:\r\n\r\n```\r\n0x2A | 0x2D | 0x2E | 0x30 .. 0x39 | 0x41 .. 0x5A | 0x5F | 0x61..0x7A => {}\r\n```\r\n\r\nthe following does not work:\r\n\r\n```\r\na @ 0x2A | 0x2D | 0x2E | 0x30 .. 0x39 | 0x41 .. 0x5A | 0x5F | 0x61..0x7A => {println(\"{}\",a)}\r\n```\r\n\r\n```\r\na @ (0x2A | 0x2D | 0x2E | 0x30 .. 0x39 | 0x41 .. 0x5A | 0x5F | 0x61..0x7A) => {println(\"{}\",a)}\r\n```\r\n\r\nIn the former example, the `a` is bound to the first literal only, and in the latter the compiler thinks that it is a tuple (and complains about the lack of commas).\r\n\r\nOf course, one can do\r\n\r\n```\r\na @ 0x2A | a @ 0x2D | a@ 0x2E | a@ 0x30 .. 0x39 /* etc */=> {println(\"{}\",a)}\r\n```\r\n\r\nbut that is cumbersome.\r\n\r\nCould we get a way to easily bind a variable to the entire match arm?\n"}}