// compile-pass // skip-codegen #![feature(associated_type_defaults)] #![allow(warnings)] trait State: Sized { type NextState: State = StateMachineEnded; fn execute(self) -> Option; } struct StateMachineEnded; impl State for StateMachineEnded { fn execute(self) -> Option { None } } fn main() { }