mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
19 lines
321 B
Rust
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() {}
|