{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/17858","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/17858/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/17858/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/17858/events","html_url":"https://github.com/rust-lang/rust/issues/17858","id":45168458,"number":17858,"title":"Misleading error with Drop and lifetime parameters","user":{"login":"bnoordhuis","id":275871,"avatar_url":"https://avatars.githubusercontent.com/u/275871?v=3","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-diagnostics","name":"A-diagnostics","color":"d7e102"}],"state":"closed","locked":false,"assignee":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2014-10-07T21:08:35Z","updated_at":"2015-11-07T06:56:30Z","closed_at":"2015-11-07T06:56:30Z","body":"```rust\r\nstruct S<'a>(&'a T);\r\n\r\nstruct T;\r\n\r\nimpl<'a> Drop for S<'a> {\r\n    fn drop(&mut self) {}\r\n}\r\n\r\nfn main() {\r\n    let _ = S(&T);\r\n}\r\n```\r\n\r\n```\r\n$ rustc -v\r\nrustc 0.12.0-nightly (b5ba2f551 2014-10-06 20:27:14 +0000)\r\n\r\n$ rustc dtor.rs \r\ndtor.rs:5:1: 7:2 error: cannot implement a destructor on a structure with type parameters [E0141]\r\ndtor.rs:5 impl<'a> Drop for S<'a> {\r\ndtor.rs:6     fn drop(&mut self) {}\r\ndtor.rs:7 }\r\ndtor.rs:5:1: 7:2 note: use \"#[unsafe_destructor]\" on the implementation to force the compiler to allow this\r\ndtor.rs:5 impl<'a> Drop for S<'a> {\r\ndtor.rs:6     fn drop(&mut self) {}\r\ndtor.rs:7 }\r\nerror: aborting due to previous error\r\n```\r\n\r\nIt's not clear to me why this program gets rejected."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/154642813","html_url":"https://github.com/rust-lang/rust/issues/17858#issuecomment-154642813","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/17858","id":154642813,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T06:56:30Z","updated_at":"2015-11-07T06:56:30Z","body":"Agree with @nham "}}