1 // Test overloaded resolution of fn_traits.
5 #![feature(unboxed_closures)]
7 #[derive(Debug, PartialEq, Eq)]
9 #[derive(Debug, PartialEq, Eq)]
13 impl FnOnce<(Ishmael,)> for CallMe {
14 type Output = Ishmael;
15 extern "rust-call" fn call_once(self, _args: (Ishmael,)) -> Ishmael {
16 println!("Split your lungs with blood and thunder!");
21 impl FnOnce<(Maybe,)> for CallMe {
23 extern "rust-call" fn call_once(self, _args: (Maybe,)) -> Maybe {
24 println!("So we just met, and this is crazy");
30 assert_eq!(CallMe(Ishmael), Ishmael);
31 assert_eq!(CallMe(Maybe), Maybe);