{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/23199","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/23199/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/23199/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/23199/events","html_url":"https://github.com/rust-lang/rust/issues/23199","id":60272136,"number":23199,"title":"Provide lint that warns .. in struct expression has no effect","user":{"login":"frewsxcv","id":416575,"avatar_url":"https://avatars.githubusercontent.com/u/416575?v=3","gravatar_id":"","url":"https://api.github.com/users/frewsxcv","html_url":"https://github.com/frewsxcv","followers_url":"https://api.github.com/users/frewsxcv/followers","following_url":"https://api.github.com/users/frewsxcv/following{/other_user}","gists_url":"https://api.github.com/users/frewsxcv/gists{/gist_id}","starred_url":"https://api.github.com/users/frewsxcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frewsxcv/subscriptions","organizations_url":"https://api.github.com/users/frewsxcv/orgs","repos_url":"https://api.github.com/users/frewsxcv/repos","events_url":"https://api.github.com/users/frewsxcv/events{/privacy}","received_events_url":"https://api.github.com/users/frewsxcv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-08T19:33:56Z","updated_at":"2015-03-08T19:56:45Z","closed_at":null,"body":"As an example:\r\n\r\n```rust\r\nstruct MyStruct {\r\n    pub a: i64,\r\n}\r\n\r\nfn main() {\r\n    let existing = MyStruct {a: 50};\r\n    MyStruct {\r\n        a: 100,\r\n        ..existing\r\n    };\r\n}\r\n```\r\n\r\nThe line containing `..existing` is unnecessary since we already explicitly state all the fields of the struct. Maybe we could have a lint so that something like this gets shown:\r\n\r\n```\r\ntmp.rs:12:17: 12:38 warning: this statement has no effect\r\ntmp.rs:12                    ..existing\r\n                             ^~~~~~~~~~\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/77770637","html_url":"https://github.com/rust-lang/rust/issues/23199#issuecomment-77770637","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/23199","id":77770637,"user":{"login":"Thiez","id":204550,"avatar_url":"https://avatars.githubusercontent.com/u/204550?v=3","gravatar_id":"","url":"https://api.github.com/users/Thiez","html_url":"https://github.com/Thiez","followers_url":"https://api.github.com/users/Thiez/followers","following_url":"https://api.github.com/users/Thiez/following{/other_user}","gists_url":"https://api.github.com/users/Thiez/gists{/gist_id}","starred_url":"https://api.github.com/users/Thiez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thiez/subscriptions","organizations_url":"https://api.github.com/users/Thiez/orgs","repos_url":"https://api.github.com/users/Thiez/repos","events_url":"https://api.github.com/users/Thiez/events{/privacy}","received_events_url":"https://api.github.com/users/Thiez/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T19:56:45Z","updated_at":"2015-03-08T19:56:45Z","body":"I can't really think of a scenario in which this would actually lead to a bug, and it could be useful to do such a useless `..existing` if you intend to add more fields to the struct in the future. Can you think of any bad behavior that the proposed lint would prevent?"}}