mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
Add regression test for #80409
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
parent
90a9f69c80
commit
2df3f490dd
36
tests/ui/inference/issue-80409.rs
Normal file
36
tests/ui/inference/issue-80409.rs
Normal file
@ -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(|_| {});
|
||||
}
|
Loading…
Reference in New Issue
Block a user