//@ check-pass pub trait Trait1 { type C; } struct T1; impl Trait1 for T1 { type C = usize; } pub trait Callback: FnMut(::C) {} impl::C)> Callback for F {} pub struct State { callback: Option>>, } impl State { fn new() -> Self { Self { callback: None } } fn test_cb(&mut self, d: ::C) { (self.callback.as_mut().unwrap())(d) } } fn main() { let mut s = State::::new(); s.test_cb(1); }