1 #[derive(Copy, Clone, PartialEq, Debug)]
7 #[derive(Copy, Clone, PartialEq, Debug)]
8 struct B<'a>(i32, &'a i32);
10 #[derive(Copy, Clone, PartialEq, Debug)]
19 let a = A { x: 99, y: &x };
20 assert_eq!(Some(a).map(Some), Some(Some(a)));
22 assert_eq!(Some(B(42, &x)), Some(f(42, &x)));
23 // the following doesn't compile :(
24 //let f: for<'a> fn(i32, &'a i32) -> B<'a> = B;
25 //assert_eq!(Some(B(42, &x)), Some(f(42, &x)));
26 assert_eq!(B(42, &x), foo(&x, B));
28 assert_eq!(C::Value(42, &x), f(42, &x));
31 fn foo<'a, F: Fn(i32, &'a i32) -> B<'a>>(i: &'a i32, f: F) -> B<'a> {