mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
18 lines
322 B
Rust
18 lines
322 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() {}
|