{"action":"created","issue":{"url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/11","repository_url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines","labels_url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/11/comments","events_url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/11/events","html_url":"https://github.com/rust-rfcs/unsafe-code-guidelines/issues/11","id":355678006,"node_id":"MDU6SXNzdWUzNTU2NzgwMDY=","number":11,"title":" Representation of structs","user":{"login":"nikomatsakis","id":155238,"node_id":"MDQ6VXNlcjE1NTIzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"labels":[{"id":1040963513,"node_id":"MDU6TGFiZWwxMDQwOTYzNTEz","url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/labels/active%20discussion%20topic","name":"active discussion topic","color":"000000","default":false},{"id":1034410309,"node_id":"MDU6TGFiZWwxMDM0NDEwMzA5","url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/labels/topic-repr","name":"topic-repr","color":"dbb51e","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2018-08-30T17:14:58Z","updated_at":"2018-09-12T13:47:15Z","closed_at":null,"author_association":"COLLABORATOR","body":"Discussion topic about how structs are represented in Rust. Some things to work out:\r\n\r\n- Do we ever say *anything* about how a `#[repr(rust)]` struct is laid out\r\n      (and/or treated by the ABI)?\r\n      - e.g., what about different structs with same definition\r\n      - across executions of the same program?\r\n- For example, [rkruppe writes](https://github.com/rust-rfcs/unsafe-code-guidelines/pull/5#discussion_r212776247) that we might \"want to guarantee (some subset of) newtype  unpacking and relegate `#[repr(transparent)]` to being the way to guarantee to other crates that a type with private fields is and will remain a newtype?\"\r\n- When is interop with `#[rust(C)]` guaranteed and what can we say there?\r\n"},"comment":{"url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/comments/420654299","html_url":"https://github.com/rust-rfcs/unsafe-code-guidelines/issues/11#issuecomment-420654299","issue_url":"https://api.github.com/repos/rust-rfcs/unsafe-code-guidelines/issues/11","id":420654299,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDY1NDI5OQ==","user":{"login":"rkruppe","id":2311707,"node_id":"MDQ6VXNlcjIzMTE3MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/2311707?v=4","gravatar_id":"","url":"https://api.github.com/users/rkruppe","html_url":"https://github.com/rkruppe","followers_url":"https://api.github.com/users/rkruppe/followers","following_url":"https://api.github.com/users/rkruppe/following{/other_user}","gists_url":"https://api.github.com/users/rkruppe/gists{/gist_id}","starred_url":"https://api.github.com/users/rkruppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkruppe/subscriptions","organizations_url":"https://api.github.com/users/rkruppe/orgs","repos_url":"https://api.github.com/users/rkruppe/repos","events_url":"https://api.github.com/users/rkruppe/events{/privacy}","received_events_url":"https://api.github.com/users/rkruppe/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T13:47:15Z","updated_at":"2018-09-12T13:47:15Z","author_association":"NONE","body":"@the8472 \r\n\r\n> But if you wanted to rely on such things then the order of fields would suddenly become part of the API contract of crates, i.e. someone just reordering their fields for code formatting reasons would suddenly become an API break if punnability were guaranteed for repr(Rust) types.\r\n\r\nGood point, though this still leaves tuple structs where order is already significant.\r\n\r\n> At a minimum you'd still need some compile-time verification that they are layout-compatible.\r\n\r\nOne should have that in any case so that a semver break (uncool but happens) does not turn into a memory safety issue (very bad).\r\n\r\n"}}
{"actor":{"display_login":"rkruppe"}}