From e9550366939e4585ca43cedbaa28e20c76a24a45 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 27 Aug 2023 23:15:47 +0200 Subject: [PATCH] Fix GNUStep NSMutableData new --- crates/icrate/tests/mutable_data.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/icrate/tests/mutable_data.rs b/crates/icrate/tests/mutable_data.rs index 3c307df4d..6c06b0000 100644 --- a/crates/icrate/tests/mutable_data.rs +++ b/crates/icrate/tests/mutable_data.rs @@ -81,7 +81,12 @@ fn test_as_ref_borrow() { fn impls_borrow + Borrow + ?Sized, U: ?Sized>(_: &T) {} fn impls_borrow_mut + BorrowMut + ?Sized, U: ?Sized>(_: &mut T) {} - let mut obj = NSMutableData::new(); + // TODO: For some reason `new` doesn't work on GNUStep in release mode? + let mut obj = if cfg!(feature = "gnustep-1-8") { + NSMutableData::with_bytes(&[]) + } else { + NSMutableData::new() + }; impls_borrow::, NSMutableData>(&obj); impls_borrow_mut::, NSMutableData>(&mut obj);