Skip to content

Commit 1424268

Browse files
authored
Rollup merge of #109968 - JohnTitor:issue-80409, r=compiler-errors
Add regression test for #80409 r? ``@compiler-errors`` Closes #80409
2 parents 9dfe4af + 2df3f49 commit 1424268

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Diff for: tests/ui/inference/issue-80409.rs

+36
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)