Skip to content

Commit f918819

Browse files
committed
Fix INSMutableArray::sort_by now that functions are zero-sized.
This was EXC_BAD_ACCESSing since that change in rust-lang/rust#19925.
1 parent 913ba54 commit f918819

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/array.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ pub trait INSMutableArray : INSArray {
261261
NSComparisonResult::from_ordering((*compare)(obj1, obj2))
262262
}
263263

264+
let f: extern fn(&Self::Item, &Self::Item, &mut F) -> NSComparisonResult =
265+
compare_with_closure;
264266
let mut closure = compare;
265267
unsafe {
266-
let _: () = msg_send![self, sortUsingFunction:compare_with_closure::<Self::Item, F>
268+
let _: () = msg_send![self, sortUsingFunction:f
267269
context:&mut closure];
268270
}
269271
}

0 commit comments

Comments
 (0)