News for hackers. Stuff that matters.
Re:A JVM in Rust part 5 – Executing instructions by pie_flavor on Monday August 28, 2023 @10:39PM (#37302941)
What is presented here is a self-referential type, and Rust does not allow you to declare self-referential types, and an indexed arena is a solution to that. You are correct that you still have all the issues you described - that doesn't mean it should be a 'last resort' to stop using an incorrect system of lifetimes, because there is no 'safe code with lifetimes' that encodes a self-referential type. The type safety issue is solved by using slotmap or typed-generational-arena, which use unique key types.

There are no comments on this comment yet.