About once or twice a week you'll see someone ask how to define something which is logically equivalent to a self-referential type.
I'm not trying to bash on people for asking these questions - I actually think it's awesome that they're stretching themselves and experimenting with lifetimes - but whenever the topic comes up we tend to shut it down saying "self-referential types are impossible in (safe) Rust so you'll need to redesign your code"... Which isn't particularly helpful when I've just engineered myself into a corner and need to refactor a couple hundred lines of code to get out.
My question to you:
- What made things finally "click" for you?
- Have you heard any particularly elegant ways of explaining self-referential types?
- What are some general strategies that you use to avoid getting into situations involving self-referential types?