{"action":"closed","issue":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1178","repository_url":"https://api.github.com/repos/Manishearth/rust-clippy","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1178/labels{/name}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1178/comments","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1178/events","html_url":"https://github.com/Manishearth/rust-clippy/issues/1178","id":172029215,"number":1178,"title":"0-prefixed integer literal (octal in lots of languages but Rust)","user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Manishearth/rust-clippy/labels/A-correctness","name":"A-correctness","color":"c2e0c6"},{"url":"https://api.github.com/repos/Manishearth/rust-clippy/labels/E-easy","name":"E-easy","color":"009800"},{"url":"https://api.github.com/repos/Manishearth/rust-clippy/labels/L-lint","name":"L-lint","color":"fef2c0"},{"url":"https://api.github.com/repos/Manishearth/rust-clippy/labels/T-AST","name":"T-AST","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-19T00:14:29Z","updated_at":"2016-08-24T03:55:04Z","closed_at":"2016-08-24T03:55:04Z","body":"In a bunch of languages (especially in the C family), the constant literal `0123` is octal. Not in Rust:\r\n\r\n```latex\r\n% cat a.rs  \r\nfn main() {\r\n    let a = 0123;\r\n    println!(\"{}\", a);\r\n}\r\n% rustc a.rs && ./a\r\n123\r\n% cat a.c\r\n#include <stdio.h>\r\n\r\nint main() {\r\n    int a = 0123;\r\n    printf(\"%d\\n\", a);\r\n}\r\n% clang a.c && ./a.out \r\n83\r\n% cat a.java\r\nclass A {\r\n    public static void main(String[] args) {\r\n        System.out.println(0123);\r\n    }\r\n}\r\n% javac a.java && java A\r\n83\r\n% python\r\nPython 3.5.2 (default, Jun 28 2016, 08:46:01) \r\n[GCC 6.1.1 20160602] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> 0123\r\n  File \"<stdin>\", line 1\r\n    0123\r\n       ^\r\nSyntaxError: invalid token\r\n```\r\n\r\nThis might be surprising for some users. We should suggest to use either `123` or `0o123`.\r\nThis is the opposite of http://www.viva64.com/en/examples/V536/. Cc #1175."}}
{"actor":{"display_login":"llogiq"}}