use std::marker::PhantomData; type Component = fn(&()); struct Wrapper { router: Router<(Component, Box)>, } struct Match(PhantomData); struct Router(PhantomData); impl Router { pub fn at(&self) -> Result, ()> { todo!() } } impl Wrapper { fn at(&self, path: &str) -> Result<(Component, Box), ()> { let (cmp, router) = self.router.at()?; //~^ ERROR mismatched types todo!() } } fn main() {}