summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-37051.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-37051.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-37051.rs b/src/test/ui/issues/issue-37051.rs
new file mode 100644
index 000000000..9cae6cf5e
--- /dev/null
+++ b/src/test/ui/issues/issue-37051.rs
@@ -0,0 +1,18 @@
+// 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() {}