News for hackers. Stuff that matters.
Re:Type-Level Programming in Rust by kevincox on Monday October 05, 2020 @02:10PM (#24690329)
One minor note is that I don't think PhantomData is required here.

  _state: PhantomData<State>
Since State is zero-sized it is free to store it in the struct.

  state: State
IIUC PhantomData is only required when you need to indicate that you are logically storing something of that type but don't want to actually store it. Since storing is free in this case you may as well just store it.
Re:Type-Level Programming in Rust by lilyball on Monday October 05, 2020 @03:11PM (#24690944)
This sounds reasonable, but personally I prefer the PhantomData as it makes it immediately obvious to the reader that this is a zero-sized type.