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;
5
5
#[ derive( Copy , Clone , Default ) ]
6
6
struct Zst ;
7
7
8
+ fn id < T > ( x : T ) -> T { x }
9
+
8
10
fn test_abi_compat < T : Clone , U : Clone > ( t : T , u : U ) {
9
11
fn id < T > ( x : T ) -> T {
10
12
x
@@ -70,8 +72,11 @@ fn main() {
70
72
test_abi_compat ( & ( ) , ptr:: NonNull :: < ( ) > :: dangling ( ) ) ;
71
73
// Reference/pointer types with different but sized pointees.
72
74
test_abi_compat ( & 0u32 , & ( [ true ; 4 ] , [ 0u32 ; 0 ] ) ) ;
75
+ // `fn` types
76
+ test_abi_compat ( main as fn ( ) , id :: < i32 > as fn ( i32 ) -> i32 ) ;
73
77
// Guaranteed null-pointer-optimizations.
74
78
test_abi_compat ( & 0u32 as * const u32 , Some ( & 0u32 ) ) ;
79
+ test_abi_compat ( main as fn ( ) , Some ( main as fn ( ) ) ) ;
75
80
test_abi_compat ( 42u32 , num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ;
76
81
test_abi_compat ( 0u32 , Some ( num:: NonZeroU32 :: new ( 1 ) . unwrap ( ) ) ) ;
77
82
You can’t perform that action at this time.
0 commit comments