Inconsistency between stacked borrows and my mental model

I asked about a vaguely similar case in this Zulip thread, where @RustyYato and @RalfJung replied:

Yato: Yes, all raw pointers have the same tag (which is untagged) right now, so making a new raw pointer to the same location revives old raw pointers incorrectly.

RalfJ: note however that to match what LLVM does with noalias , we need to eventually also track raw pointers better and then that kind of code would stop working

So I believe this is a known limitation of the current Stacked Borrows model which might be changed in future revisions.

3 Likes