Converting between (unsized) transparent types safely in place

The RFC repo, and see also the RFC book. (From the book you have to check the tracking issues at a minimum to see the actual state of things.)

There's no spec yet, but generally: official documentation and RFCs. The idea behind UCG was to work towards a spec or at least more RFCs, but it blew up and stalled out somewhat, sadly.

Relevant quote.

Anyway: the standard library docs say "check the nomicon"
then the nomicon says "here is some advice and ultimately we don't know, maybe check UCG"
then UCG says "ultimately we don't know it's probably like this but there's no RFC yet"
then Ralf says "probably it should be allowed if the layout matches".

(This is another reason the answer is always "it's guaranteed" or "don't assume anything", and not "definitely defined", "definitely UB", or "technically unsound but ok as things are implemented for now". There's no solid line between the latter two yet.)

Yes.

3 Likes