You had to drop the deref protection for this, though.
If a deref coercion actually ends up in a different allocation, offset_from
will detect that -- you crucially rely on this computation happening at compile-time though, so there should be a comment for that.
But it is also conceivable that a deref coercion stays inside the same struct... and I am curious how weird that can get? I first thought this could be impure, but since you are running this at const-time we'd actually get an error if the deref code wasn't const-compatible. Probably right now being in a const context entirely protects you against deref coercions as those are non-const fn
-calls; that check will get relaxed eventually though.