{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/20830","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/20830/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/20830/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/20830/events","html_url":"https://github.com/rust-lang/rust/issues/20830","id":53918791,"number":20830,"title":"Identifiers in range notation are not parsed correctly","user":{"login":"aepsil0n","id":3098430,"avatar_url":"https://avatars.githubusercontent.com/u/3098430?v=3","gravatar_id":"","url":"https://api.github.com/users/aepsil0n","html_url":"https://github.com/aepsil0n","followers_url":"https://api.github.com/users/aepsil0n/followers","following_url":"https://api.github.com/users/aepsil0n/following{/other_user}","gists_url":"https://api.github.com/users/aepsil0n/gists{/gist_id}","starred_url":"https://api.github.com/users/aepsil0n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aepsil0n/subscriptions","organizations_url":"https://api.github.com/users/aepsil0n/orgs","repos_url":"https://api.github.com/users/aepsil0n/repos","events_url":"https://api.github.com/users/aepsil0n/events{/privacy}","received_events_url":"https://api.github.com/users/aepsil0n/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-nominated","name":"I-nominated","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-09T21:46:02Z","updated_at":"2015-01-09T22:25:04Z","closed_at":null,"body":"The following example fails to compile currently:\r\n\r\n```rust\r\nlet a = 3;\r\nfor i in 0..a {\r\n    let b = i;\r\n}\r\n```\r\n\r\nwith\r\n```\r\n<anon>:4:9: 4:12 error: expected identifier, found keyword `let`\r\n<anon>:4         let b = i;\r\n                 ^~~\r\n<anon>:4:13: 4:14 error: expected `:`, found `b`\r\n<anon>:4         let b = i;\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/69409875","html_url":"https://github.com/rust-lang/rust/issues/20830#issuecomment-69409875","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/20830","id":69409875,"user":{"login":"aepsil0n","id":3098430,"avatar_url":"https://avatars.githubusercontent.com/u/3098430?v=3","gravatar_id":"","url":"https://api.github.com/users/aepsil0n","html_url":"https://github.com/aepsil0n","followers_url":"https://api.github.com/users/aepsil0n/followers","following_url":"https://api.github.com/users/aepsil0n/following{/other_user}","gists_url":"https://api.github.com/users/aepsil0n/gists{/gist_id}","starred_url":"https://api.github.com/users/aepsil0n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aepsil0n/subscriptions","organizations_url":"https://api.github.com/users/aepsil0n/orgs","repos_url":"https://api.github.com/users/aepsil0n/repos","events_url":"https://api.github.com/users/aepsil0n/events{/privacy}","received_events_url":"https://api.github.com/users/aepsil0n/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T22:25:04Z","updated_at":"2015-01-09T22:25:04Z","body":"Maybe this sheds some more light on it:\r\n\r\n```rust\r\nlet a = 3;\r\nfor i in 0..a {}\r\n```\r\n\r\nApparently the compiler parses it as `for i in 0..(a {})` interpreting `a {}` as a structure literal.\r\n\r\nError:\r\n```\r\n<anon>:3:19: 3:20 error: structure literal must either have at least one field or use functional structure update syntax\r\n<anon>:3     for i in 0..a {}\r\n                           ^\r\n<anon>:4:1: 4:2 error: expected `{`, found `}`\r\n<anon>:4 }\r\n         ^\r\n<anon>:4:1: 4:2 help: place this code inside a block\r\n<anon>:4 }\r\n         ^\r\n```"}}