{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifddp2y5gd2jxrwe6izc5nbchhascb42h54hyfjtnvcuyamz4qdve",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3miwgy2abvfu2"
  },
  "path": "/t/design-idea-modeling-lifetimes-as-rotational-phases/24140#post_5",
  "publishedAt": "2026-04-07T18:08:17.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "(click for more details)"
  ],
  "textContent": "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...\n\n`Phase<'a, T>` is kind of a mutable reference `&'a mut T` or a cell...\nUnsoundly created, at that.\n\n\n    fn main() {\n        let axis = SigmaAxis::new(100);\n\n        let mut phase_0 = axis.initialize();\n        let mut phase_1 = axis.initialize();\n\n        phase_1.execute(|d| {\n            *d *= 2;\n            phase_0.execute(|d| *d += 10);\n            *d /= 2;\n        });\n    }\n\n\nMiri report (click for more details)\n\nOn 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.",
  "title": "Design idea: Modeling lifetimes as rotational phases"
}