{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27266","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27266/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27266/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27266/events","html_url":"https://github.com/rust-lang/rust/issues/27266","id":97127895,"number":27266,"title":"Lint against calling .clone() on an otherwise copyable value.","user":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-lint","name":"A-lint","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-24T19:38:22Z","updated_at":"2016-04-26T22:01:21Z","closed_at":"2016-02-11T20:07:13Z","body":"Certain types could start out as having contents that move and then switch to only copyable field, or could just be missing `#[deriving(Copy)]` initially.\r\n\r\nIf `Copy` is implemented after that type has been used in a large codebase (there's a few cases in `rustc` itself), there will likely be many `.clone()` calls around, and finding which ones belong to the type could be tedious.\r\n\r\nA lint would ease this work, by suggesting the replacement of an unnecessary `x.clone()` call with a dereference (if `x` is a reference to the type being cloned - could use the autoderef count here) or nothing at all (since using a `Copy` lvalue as an rvalue will just copy it)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/214901255","html_url":"https://github.com/rust-lang/rust/issues/27266#issuecomment-214901255","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/27266","id":214901255,"user":{"login":"ubsan","id":3479021,"avatar_url":"https://avatars.githubusercontent.com/u/3479021?v=3","gravatar_id":"","url":"https://api.github.com/users/ubsan","html_url":"https://github.com/ubsan","followers_url":"https://api.github.com/users/ubsan/followers","following_url":"https://api.github.com/users/ubsan/following{/other_user}","gists_url":"https://api.github.com/users/ubsan/gists{/gist_id}","starred_url":"https://api.github.com/users/ubsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubsan/subscriptions","organizations_url":"https://api.github.com/users/ubsan/orgs","repos_url":"https://api.github.com/users/ubsan/repos","events_url":"https://api.github.com/users/ubsan/events{/privacy}","received_events_url":"https://api.github.com/users/ubsan/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T22:01:21Z","updated_at":"2016-04-26T22:01:21Z","body":"This seems really useful in normal rust, like with <&T>::clone"}}