File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
tests/pass/function_calls Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ use std::ptr;
55#[ derive( Copy , Clone , Default ) ]
66struct Zst ;
77
8+ fn id < T > ( x : T ) -> T { x }
9+
810fn test_abi_compat < T : Clone , U : Clone > ( t : T , u : U ) {
911 fn id < T > ( x : T ) -> T {
1012 x
@@ -70,8 +72,11 @@ fn main() {
7072 test_abi_compat ( & ( ) , ptr:: NonNull :: < ( ) > :: dangling ( ) ) ;
7173 // Reference/pointer types with different but sized pointees.
7274 test_abi_compat ( & 0u32 , & ( [ true ; 4 ] , [ 0u32 ; 0 ] ) ) ;
75+ // `fn` types
76+ test_abi_compat ( main as fn ( ) , id :: < i32 > as fn ( i32 ) -> i32 ) ;
7377 // Guaranteed null-pointer-optimizations.
7478 test_abi_compat ( & 0u32 as * const u32 , Some ( & 0u32 ) ) ;
79+ test_abi_compat ( main as fn ( ) , Some ( main as fn ( ) ) ) ;
7580 test_abi_compat ( 42u32 , num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ;
7681 test_abi_compat ( 0u32 , Some ( num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ) ;
7782
You can’t perform that action at this time.
0 commit comments