// run-pass #![feature(box_syntax)] fn test_generic(expected: Box, eq: F) where T: Clone, F: FnOnce(Box, Box) -> bool { let actual: Box = { expected.clone() }; assert!(eq(expected, actual)); } fn test_box() { fn compare_box(b1: Box, b2: Box) -> bool { println!("{}", *b1); println!("{}", *b2); return *b1 == *b2; } test_generic::(box true, compare_box); } pub fn main() { test_box(); }