{"action":"created","issue":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/208","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/208/comments","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/208/events","html_url":"https://github.com/Manishearth/rust-clippy/pull/208","id":102020072,"number":208,"title":"Implementation of lossy cast lints (issue #114)","user":{"login":"Robzz","id":304428,"avatar_url":"https://avatars.githubusercontent.com/u/304428?v=3","gravatar_id":"","url":"https://api.github.com/users/Robzz","html_url":"https://github.com/Robzz","followers_url":"https://api.github.com/users/Robzz/followers","following_url":"https://api.github.com/users/Robzz/following{/other_user}","gists_url":"https://api.github.com/users/Robzz/gists{/gist_id}","starred_url":"https://api.github.com/users/Robzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Robzz/subscriptions","organizations_url":"https://api.github.com/users/Robzz/orgs","repos_url":"https://api.github.com/users/Robzz/repos","events_url":"https://api.github.com/users/Robzz/events{/privacy}","received_events_url":"https://api.github.com/users/Robzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-19T23:06:48Z","updated_at":"2015-08-20T13:55:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/208","html_url":"https://github.com/Manishearth/rust-clippy/pull/208","diff_url":"https://github.com/Manishearth/rust-clippy/pull/208.diff","patch_url":"https://github.com/Manishearth/rust-clippy/pull/208.patch"},"body":"This PR introduces the 3 lints suggested by @llogiq in #114 along with a test case.\r\n\r\nThere must be a way to refactor the code (some match arms are exactly the same except for a variant), but I'm no expert in matching patterns and I haven't found how. I thought of macros, but it seems way overkill. Advice appreciated.\r\n\r\nWith dogfood.sh, the cast_precision_loss lint triggered 2 errors in src/consts.rs. I silenced them because although there is a loss of precision, the code seems legit.\r\n\r\nAlso, keep in mind that as I matched on the actual type variants (I didn't find a way to ask rustc for the type's size), this is not generic and will need updating as larger types are added to rust.\r\n\r\nAnd there goes my first nontrivial contribution to an open-source project :smile:"},"comment":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/comments/133016302","html_url":"https://github.com/Manishearth/rust-clippy/pull/208#issuecomment-133016302","issue_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/208","id":133016302,"user":{"login":"llogiq","id":4200835,"avatar_url":"https://avatars.githubusercontent.com/u/4200835?v=3","gravatar_id":"","url":"https://api.github.com/users/llogiq","html_url":"https://github.com/llogiq","followers_url":"https://api.github.com/users/llogiq/followers","following_url":"https://api.github.com/users/llogiq/following{/other_user}","gists_url":"https://api.github.com/users/llogiq/gists{/gist_id}","starred_url":"https://api.github.com/users/llogiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llogiq/subscriptions","organizations_url":"https://api.github.com/users/llogiq/orgs","repos_url":"https://api.github.com/users/llogiq/repos","events_url":"https://api.github.com/users/llogiq/events{/privacy}","received_events_url":"https://api.github.com/users/llogiq/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T13:55:31Z","updated_at":"2015-08-20T13:55:31Z","body":":+1: for merge without `*size` handling once the other things are finished.\r\n\r\nWe can add the arch-dependent lint variant later."}}