Relative Pointer: an abstraction to build movable self-referential types

#21

Ok, thank you very much!


Whoops: meant to reply to @RalfJung

0 Likes

#22

Sorry for being too creative :innocent:. I was just trying to suggest it’s better to be careful and suspect the worst from the compiler when unsafe code comes around and not to take even such „obvious“ assumptions for granted.

2 Likes

#23

No, its good, I hadn’t thought of that

1 Like

#24

Since with 1.34, NonZeroISize is stable, you can finally have optimized offsets for the &mut _ case :slight_smile:

1 Like

#25

Yay!

1 Like

#26

rel-ptr is now updated to allow NonZero* offsets, so you can have space optimizations for RelPtr<_, NonZeroI*> have the same size as Option<RelPtr<_, NonZeroI*>> on stable!

2 Likes