rust/src/test/ui/issues/issue-37051.rs
2019-06-16 12:23:22 +03:00

19 lines
321 B
Rust

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