Skip to content

Commit

Permalink
Rollup merge of #109968 - JohnTitor:issue-80409, r=compiler-errors
Browse files Browse the repository at this point in the history
Add regression test for #80409

r? ``@compiler-errors``
Closes #80409
  • Loading branch information
JohnTitor authored Apr 5, 2023
2 parents 9dfe4af + 2df3f49 commit 1424268
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/ui/inference/issue-80409.rs
Original file line number Diff line number Diff line change
@@ -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(|_| {});
}

0 comments on commit 1424268

Please sign in to comment.