#![crate_type = "lib"] pub trait Future { type Item; type Error; } impl Future for u32 { type Item = (); type Error = Box<()>; } fn foo() -> Box>> { Box::new(0u32) } pub fn bar(_s: F) where F: Fn(A) -> B, { foo(); }