We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9dfe4af + 2df3f49 commit 1424268Copy full SHA for 1424268
tests/ui/inference/issue-80409.rs
@@ -0,0 +1,36 @@
1
+// check-pass
2
+
3
+#![allow(unreachable_code, unused)]
4
5
+use std::marker::PhantomData;
6
7
+struct FsmBuilder<TFsm> {
8
+ _fsm: PhantomData<TFsm>,
9
+}
10
11
+impl<TFsm> FsmBuilder<TFsm> {
12
+ fn state(&mut self) -> FsmStateBuilder<TFsm> {
13
+ todo!()
14
+ }
15
16
17
+struct FsmStateBuilder<TFsm> {
18
+ _state: PhantomData<TFsm>,
19
20
21
+impl<TFsm> FsmStateBuilder<TFsm> {
22
+ fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {}
23
24
25
+trait Fsm {
26
+ type Context;
27
28
29
+struct StateContext<'a, TFsm: Fsm> {
30
+ context: &'a mut TFsm::Context,
31
32
33
+fn main() {
34
+ let mut builder: FsmBuilder<usize> = todo!();
35
+ builder.state().on_entry(|_| {});
36
0 commit comments