{"action":"created","issue":{"url":"https://api.github.com/repos/bluss/arrayvec/issues/6","labels_url":"https://api.github.com/repos/bluss/arrayvec/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/bluss/arrayvec/issues/6/comments","events_url":"https://api.github.com/repos/bluss/arrayvec/issues/6/events","html_url":"https://github.com/bluss/arrayvec/pull/6","id":102230961,"number":6,"title":"Use NoDrop to fix panic safety issues","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-20T20:34:33Z","updated_at":"2015-08-20T22:13:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bluss/arrayvec/pulls/6","html_url":"https://github.com/bluss/arrayvec/pull/6","diff_url":"https://github.com/bluss/arrayvec/pull/6.diff","patch_url":"https://github.com/bluss/arrayvec/pull/6.patch"},"body":"ArrayVec::drop was not panic safe — if there would be a panic during an\r\nelement's drop, the discriminant would never be set to Dropped, and the\r\narray elements would potentially double drop.\r\n\r\nFix this by going back to the old NoDrop composition. The NoDrop struct\r\nthas its own Drop impl, that will trigger too on panic during an element's\r\ndrop. This serves to make ArrayVec::drop panic safe.\r\n\r\nAlso tweak IntoIter::drop to make it panic safe: set inner ArrayVec's\r\nlength before dropping any elements.\r\n\r\nThank you to @Stebalien for reporting this bug and providing the\r\nexcellent testcases in this commit.\r\n\r\nUsing NoDrop expands ArrayVec to have two drop flags again, but this\r\nis a temporary tradeoff, drop flags will eventually go away.\r\n\r\nFixes #3"},"comment":{"url":"https://api.github.com/repos/bluss/arrayvec/issues/comments/133194603","html_url":"https://github.com/bluss/arrayvec/pull/6#issuecomment-133194603","issue_url":"https://api.github.com/repos/bluss/arrayvec/issues/6","id":133194603,"user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T22:13:50Z","updated_at":"2015-08-20T22:13:50Z","body":"Thank you for helping with this!"}}