3 #![allow(unused_variables)]
4 // Test explicit coercions from a fn item type to a fn pointer type.
7 fn foo(x: isize) -> isize { x * 2 }
8 fn bar(x: isize) -> isize { x * 4 }
9 type IntMap = fn(isize) -> isize;
11 fn eq<T>(x: T, y: T) { }
13 static TEST: Option<IntMap> = Some(foo as IntMap);
16 let f = foo as IntMap;
18 let f = if true { foo as IntMap } else { bar as IntMap };
21 eq(foo as IntMap, bar as IntMap);