External Publication
Visit Post

Design idea: Modeling lifetimes as rotational phases

Rust Internals [Unofficial] April 7, 2026
Source

First of all, it's noticeable that rotation has zero effect in the code; your sample program still compiles if you remove any rotations and complete_cycle()-s, calling phase_0.execute each time. With that, let's understand what this code does...

Phase<'a, T> is kind of a mutable reference &'a mut T or a cell... Unsoundly created, at that.

fn main() {
    let axis = SigmaAxis::new(100);

    let mut phase_0 = axis.initialize();
    let mut phase_1 = axis.initialize();

    phase_1.execute(|d| {
        *d *= 2;
        phase_0.execute(|d| *d += 10);
        *d /= 2;
    });
}

Miri report (click for more details)

On to a more practical note : LLMs tend to check themselves a slight bit better if you open a new dialogue and copy whatever you are working with. Note that they can be convinced that an 'insight' is 'brilliant' even if it is erroneous so you still need to apply your judgement.

Discussion in the ATmosphere

Loading comments...