@@ -77,7 +77,7 @@ impl<T: ?Sized> CFArray<T> {
7777 //
7878 // The objects are retained internally by the array, so we do not need
7979 // to keep them alive ourselves after this.
80- let array = unsafe { CFArray :: new ( None , ptr, len, & kCFTypeArrayCallBacks) }
80+ let array = unsafe { CFArray :: new ( None , ptr, len, Some ( & kCFTypeArrayCallBacks) ) }
8181 . unwrap_or_else ( || failed_creating_array ( len) ) ;
8282
8383 // SAFETY: The objects came from `T`.
@@ -107,7 +107,7 @@ impl<T: ?Sized> CFArray<T> {
107107 let ptr = objects. as_ptr ( ) . cast :: < * const c_void > ( ) . cast_mut ( ) ;
108108
109109 // SAFETY: Same as in `from_objects`.
110- let array = unsafe { CFArray :: new ( None , ptr, len, & kCFTypeArrayCallBacks) }
110+ let array = unsafe { CFArray :: new ( None , ptr, len, Some ( & kCFTypeArrayCallBacks) ) }
111111 . unwrap_or_else ( || failed_creating_array ( len) ) ;
112112
113113 // SAFETY: The objects came from `T`.
@@ -139,7 +139,7 @@ impl<T: ?Sized> CFMutableArray<T> {
139139
140140 // SAFETY: The objects are CFTypes (`T: Type` bound), and the array
141141 // callbacks are thus correct.
142- let array = unsafe { CFMutableArray :: new ( None , capacity, & kCFTypeArrayCallBacks) }
142+ let array = unsafe { CFMutableArray :: new ( None , capacity, Some ( & kCFTypeArrayCallBacks) ) }
143143 . unwrap_or_else ( || failed_creating_array ( capacity) ) ;
144144
145145 // SAFETY: The array contains no objects yet, and thus it's safe to
@@ -540,7 +540,7 @@ mod tests {
540540 fn array_with_invalid_pointers ( ) {
541541 // without_provenance
542542 let ptr = [ 0 as _ , 1 as _ , 2 as _ , 3 as _ , usize:: MAX as _ ] . as_mut_ptr ( ) ;
543- let array = unsafe { CFArray :: new ( None , ptr, 1 , null ( ) ) } . unwrap ( ) ;
543+ let array = unsafe { CFArray :: new ( None , ptr, 1 , None ) } . unwrap ( ) ;
544544 let value = unsafe { array. value_at_index ( 0 ) } ;
545545 assert ! ( value. is_null( ) ) ;
546546 }
@@ -550,7 +550,7 @@ mod tests {
550550 #[ ignore = "aborts (as expected)" ]
551551 fn object_array_cannot_contain_null ( ) {
552552 let ptr = [ null ( ) ] . as_mut_ptr ( ) ;
553- let _array = unsafe { CFArray :: new ( None , ptr, 1 , & kCFTypeArrayCallBacks) } ;
553+ let _array = unsafe { CFArray :: new ( None , ptr, 1 , Some ( & kCFTypeArrayCallBacks) ) } ;
554554 }
555555
556556 #[ test]
0 commit comments