fn main() { let foo: &dyn Demo<_> = &(); foo.do_something(); } trait Demo { fn do_something(&self) -> T; } impl Demo for () { fn do_something(&self) -> f32 { kaz(); 3.14 } } fn kaz() {}