]> git.proxmox.com Git - rustc.git/blobdiff - tests/ui/inference/issue-80409.rs
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / tests / ui / inference / issue-80409.rs
diff --git a/tests/ui/inference/issue-80409.rs b/tests/ui/inference/issue-80409.rs
new file mode 100644 (file)
index 0000000..80cad6d
--- /dev/null
@@ -0,0 +1,36 @@
+// check-pass
+
+#![allow(unreachable_code, unused)]
+
+use std::marker::PhantomData;
+
+struct FsmBuilder<TFsm> {
+    _fsm: PhantomData<TFsm>,
+}
+
+impl<TFsm> FsmBuilder<TFsm> {
+    fn state(&mut self) -> FsmStateBuilder<TFsm> {
+        todo!()
+    }
+}
+
+struct FsmStateBuilder<TFsm> {
+    _state: PhantomData<TFsm>,
+}
+
+impl<TFsm> FsmStateBuilder<TFsm> {
+    fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {}
+}
+
+trait Fsm {
+    type Context;
+}
+
+struct StateContext<'a, TFsm: Fsm> {
+    context: &'a mut TFsm::Context,
+}
+
+fn main() {
+    let mut builder: FsmBuilder<usize> = todo!();
+    builder.state().on_entry(|_| {});
+}