{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/1423","repository_url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen","labels_url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/1423/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/1423/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/1423/events","html_url":"https://github.com/rust-lang-nursery/rust-bindgen/issues/1423","id":371275651,"node_id":"MDU6SXNzdWUzNzEyNzU2NTE=","number":1423,"title":"Provide safe allocation API for varsized structs","user":{"login":"alex","id":772,"node_id":"MDQ6VXNlcjc3Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/772?v=4","gravatar_id":"","url":"https://api.github.com/users/alex","html_url":"https://github.com/alex","followers_url":"https://api.github.com/users/alex/followers","following_url":"https://api.github.com/users/alex/following{/other_user}","gists_url":"https://api.github.com/users/alex/gists{/gist_id}","starred_url":"https://api.github.com/users/alex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex/subscriptions","organizations_url":"https://api.github.com/users/alex/orgs","repos_url":"https://api.github.com/users/alex/repos","events_url":"https://api.github.com/users/alex/events{/privacy}","received_events_url":"https://api.github.com/users/alex/received_events","type":"User","site_admin":false},"labels":[{"id":396826311,"node_id":"MDU6TGFiZWwzOTY4MjYzMTE=","url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":396826312,"node_id":"MDU6TGFiZWwzOTY4MjYzMTI=","url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-17T21:32:36Z","updated_at":"2018-11-08T00:31:42Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently if you have a varsized struct (`struct { size_t length; uint64_t data[] };`), you're responsible for figuring out how to allocate it yourself, which can be messy and `unsafe`.\r\n\r\nWould it be reasonable for the generated Rust type for that struct to have an API for allocating it, with a certain length (NB, the user would still be responsible for filling in the `length` field)?\r\n\r\nThis would be beneficial by a) being more ergonomic, and more importantly b) consistently handling things like integer overflows to make code safer!"},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/comments/436829036","html_url":"https://github.com/rust-lang-nursery/rust-bindgen/issues/1423#issuecomment-436829036","issue_url":"https://api.github.com/repos/rust-lang-nursery/rust-bindgen/issues/1423","id":436829036,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjgyOTAzNg==","user":{"login":"emilio","id":1323194,"node_id":"MDQ6VXNlcjEzMjMxOTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1323194?v=4","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T00:31:42Z","updated_at":"2018-11-08T00:31:42Z","author_association":"COLLABORATOR","body":"That's all in `src/codegen/mod.rs`."}}
{"actor":{"display_login":"emilio"}}