Reducing Raw Pointer Footguns: Preventing Reference Aliasing Violations at Compile Time
Rust Internals [Unofficial]
May 16, 2026
The example gives compile time error. Did you run with the code in the opening post? The newest code is in the reply. I will put it in the opening post
Where 1 one the example is indeed invalidate the head. That is because I didn't wrap the head pointer with the guard. After I wrap all will guard, it now prevents the head pointer invalidation
Discussion in the ATmosphere