Stream: t-lang/wg-unsafe-code-guidelines

Topic: Layout stability?


RalfJ (Jun 23 2019 at 11:02, on Zulip):

AFAIK we don't say anything about layout stability yet in our "book"? I can't even find a section on the topic where we say that pretty much everything is open. And maybe we can at least say that running the same binary multiple times will always use the same layout?
Also see https://internals.rust-lang.org/t/when-is-the-abi-stable/10420

rkruppe (Jun 23 2019 at 11:07, on Zulip):

For structs we have (https://rust-lang.github.io/unsafe-code-guidelines/layout/structs-and-tuples.html#default-layout-repr-rust):

A note on determinism. The definition above does not guarantee determinism between executions of the compiler -- two executions may select different layouts, even if all inputs are identical. Naturally, in practice, the compiler aims to produce deterministic output for a given set of inputs. However, it is difficult to produce a comprehensive summary of the various factors that may affect the layout of structs, and so for the time being we have opted for a conservative definition.

RalfJ (Jun 23 2019 at 11:09, on Zulip):

hm I see. that doesn't really have anything to do with structs though? It should be in a dedicated section IMO.

RalfJ (Jun 23 2019 at 12:15, on Zulip):

issue created at https://github.com/rust-lang/unsafe-code-guidelines/issues/151

Jake Goulding (Jun 23 2019 at 15:09, on Zulip):

A lot of this exists in nascent form at https://doc.rust-lang.org/stable/reference/type-layout.html

gnzlbg (Jun 24 2019 at 12:55, on Zulip):

What do you have in mind ?

Last update: Nov 19 2019 at 18:55UTC