From 371fc738e812993baf8cdf57d3404a2217532a22 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 21 Nov 2024 18:19:22 +0100 Subject: [PATCH] Rename internal send_message_id to send_message_retained --- crates/objc2/src/__macro_helpers/msg_send.rs | 2 +- .../src/__macro_helpers/msg_send_retained.rs | 105 +++++++++++------- crates/objc2/src/macros/__method_msg_send.rs | 6 +- crates/objc2/src/macros/__msg_send_parse.rs | 6 +- crates/objc2/src/macros/mod.rs | 18 +-- .../crates/test_autorelease_return/lib.rs | 2 +- .../crates/test_msg_send_error/lib.rs | 8 +- .../crates/test_msg_send_retained/lib.rs | 32 +++--- .../ui/extern_methods_invalid_receiver.stderr | 8 +- .../ui/extern_methods_invalid_type.stderr | 12 +- .../ui/msg_send_alloc_init_different.stderr | 6 +- .../test-ui/ui/msg_send_invalid_error.stderr | 8 +- .../ui/msg_send_invalid_receiver.stderr | 20 ++-- .../test-ui/ui/msg_send_invalid_return.stderr | 72 ++++++------ 14 files changed, 165 insertions(+), 140 deletions(-) diff --git a/crates/objc2/src/__macro_helpers/msg_send.rs b/crates/objc2/src/__macro_helpers/msg_send.rs index 4d1b6b8a0..31a1a58de 100644 --- a/crates/objc2/src/__macro_helpers/msg_send.rs +++ b/crates/objc2/src/__macro_helpers/msg_send.rs @@ -70,7 +70,7 @@ pub trait MsgSend: Sized { unsafe { self.send_super_message(::Super::class(), sel, args) } } - // Error functions below. See MsgSendRetained::send_message_id_error for further + // Error functions below. See MsgSendRetained::send_message_retained_error for further // details. // // Some of this could be abstracted away using closures, but that would diff --git a/crates/objc2/src/__macro_helpers/msg_send_retained.rs b/crates/objc2/src/__macro_helpers/msg_send_retained.rs index 43de3310d..232afa3e8 100644 --- a/crates/objc2/src/__macro_helpers/msg_send_retained.rs +++ b/crates/objc2/src/__macro_helpers/msg_send_retained.rs @@ -10,17 +10,21 @@ use super::{Alloc, ConvertArguments, CopyOrMutCopy, Init, MsgSend, New, Other, T pub trait MsgSendRetained { #[track_caller] - unsafe fn send_message_id>( + unsafe fn send_message_retained>( obj: T, sel: Sel, args: A, ) -> R; /// Add an extra error argument to the argument list, call - /// `send_message_id` with that, and return an error if one occurred. + /// `send_message_retained` with that, and return an error if one occurred. #[inline] #[track_caller] - unsafe fn send_message_id_error(obj: T, sel: Sel, args: A) -> Result> + unsafe fn send_message_retained_error( + obj: T, + sel: Sel, + args: A, + ) -> Result> where *mut *mut E: Encode, A: TupleExtender<*mut *mut E>, @@ -30,7 +34,7 @@ pub trait MsgSendRetained { { let mut err: *mut E = ptr::null_mut(); let args = args.add_argument(&mut err); - let res: Option = unsafe { Self::send_message_id(obj, sel, args) }; + let res: Option = unsafe { Self::send_message_retained(obj, sel, args) }; // As per the Cocoa documentation: // > Success or failure is indicated by the return value of the // > method. Although Cocoa methods that indirectly return error @@ -67,7 +71,7 @@ pub trait MsgSendRetained { pub trait MsgSendSuperRetained { type Inner: ?Sized + RefEncode; - unsafe fn send_super_message_id>( + unsafe fn send_super_message_retained>( obj: T, superclass: &AnyClass, sel: Sel, @@ -76,7 +80,7 @@ pub trait MsgSendSuperRetained { #[inline] #[track_caller] - unsafe fn send_super_message_id_static>( + unsafe fn send_super_message_retained_static>( obj: T, sel: Sel, args: A, @@ -86,13 +90,18 @@ pub trait MsgSendSuperRetained { ::Super: ClassType, { unsafe { - Self::send_super_message_id(obj, ::Super::class(), sel, args) + Self::send_super_message_retained( + obj, + ::Super::class(), + sel, + args, + ) } } #[inline] #[track_caller] - unsafe fn send_super_message_id_error( + unsafe fn send_super_message_retained_error( obj: T, superclass: &AnyClass, sel: Sel, @@ -107,19 +116,20 @@ pub trait MsgSendSuperRetained { { let mut err: *mut E = ptr::null_mut(); let args = args.add_argument(&mut err); - // SAFETY: See `send_message_id_error` - let res: Option = unsafe { Self::send_super_message_id(obj, superclass, sel, args) }; + // SAFETY: See `send_message_retained_error` + let res: Option = + unsafe { Self::send_super_message_retained(obj, superclass, sel, args) }; if let Some(res) = res { Ok(res) } else { - // SAFETY: See `send_message_id_error` + // SAFETY: See `send_message_retained_error` Err(unsafe { encountered_error(err) }) } } #[inline] #[track_caller] - unsafe fn send_super_message_id_static_error( + unsafe fn send_super_message_retained_static_error( obj: T, sel: Sel, args: A, @@ -135,12 +145,12 @@ pub trait MsgSendSuperRetained { { let mut err: *mut E = ptr::null_mut(); let args = args.add_argument(&mut err); - // SAFETY: See `send_message_id_error` - let res: Option = unsafe { Self::send_super_message_id_static(obj, sel, args) }; + // SAFETY: See `send_message_retained_error` + let res: Option = unsafe { Self::send_super_message_retained_static(obj, sel, args) }; if let Some(res) = res { Ok(res) } else { - // SAFETY: See `send_message_id_error` + // SAFETY: See `send_message_retained_error` Err(unsafe { encountered_error(err) }) } } @@ -158,7 +168,10 @@ unsafe fn encountered_error(err: *mut E) -> Retained { impl MsgSendRetained>> for New { #[inline] - unsafe fn send_message_id>>>( + unsafe fn send_message_retained< + A: ConvertArguments, + R: MaybeUnwrap>>, + >( obj: T, sel: Sel, args: A, @@ -179,7 +192,7 @@ impl MsgSendSuperRetained type Inner = T::Inner; #[inline] - unsafe fn send_super_message_id< + unsafe fn send_super_message_retained< A: ConvertArguments, R: MaybeUnwrap>>, >( @@ -189,18 +202,18 @@ impl MsgSendSuperRetained args: A, ) -> R { let ptr = obj.into_raw_receiver(); - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { MsgSend::send_super_message(ptr, superclass, sel, args) }; - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { Retained::from_raw(obj) }; - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` R::maybe_unwrap::(obj, (unsafe { ptr.as_ref() }, sel)) } } impl MsgSendRetained<&'_ AnyClass, Allocated> for Alloc { #[inline] - unsafe fn send_message_id>>( + unsafe fn send_message_retained>>( cls: &AnyClass, sel: Sel, args: A, @@ -217,15 +230,18 @@ impl MsgSendSuperRetained<&'_ AnyClass, Allocated> for A type Inner = AnyClass; #[inline] - unsafe fn send_super_message_id>>( + unsafe fn send_super_message_retained< + A: ConvertArguments, + R: MaybeUnwrap>, + >( cls: &AnyClass, superclass: &AnyClass, sel: Sel, args: A, ) -> R { - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { MsgSend::send_super_message(cls, superclass, sel, args) }; - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { Allocated::new(obj) }; R::maybe_unwrap::(obj, ()) } @@ -234,7 +250,7 @@ impl MsgSendSuperRetained<&'_ AnyClass, Allocated> for A impl Alloc { /// Fast path optimization for `msg_send_id![cls, alloc]`. #[inline] - pub unsafe fn send_message_id_alloc>>( + pub unsafe fn send_message_retained_alloc>>( cls: &AnyClass, ) -> R { // Available on non-fragile Apple runtimes. @@ -255,14 +271,17 @@ impl Alloc { )))] { // SAFETY: Checked by caller - unsafe { Alloc::send_message_id(cls, sel!(alloc), ()) } + unsafe { Alloc::send_message_retained(cls, sel!(alloc), ()) } } } } impl MsgSendRetained, Option>> for Init { #[inline] - unsafe fn send_message_id>>>( + unsafe fn send_message_retained< + A: ConvertArguments, + R: MaybeUnwrap>>, + >( obj: Allocated, sel: Sel, args: A, @@ -285,7 +304,7 @@ impl MsgSendSuperRetained, Option>> type Inner = T; #[inline] - unsafe fn send_super_message_id< + unsafe fn send_super_message_retained< A: ConvertArguments, R: MaybeUnwrap>>, >( @@ -295,7 +314,7 @@ impl MsgSendSuperRetained, Option>> args: A, ) -> R { let ptr = PartialInit::into_ptr(obj); - // SAFETY: Same as `send_message_id`. + // SAFETY: Same as `send_message_retained`. let ptr = unsafe { MsgSend::send_super_message(ptr, superclass, sel, args) }; // SAFETY: The returned pointer is the same as the one we passed in. // @@ -304,7 +323,7 @@ impl MsgSendSuperRetained, Option>> if let Some(ptr) = NonNull::new(ptr) { unsafe { set_finalized(ptr) }; } - // SAFETY: Same as `send_message_id` + // SAFETY: Same as `send_message_retained` let obj = unsafe { Retained::from_raw(ptr) }; R::maybe_unwrap::(obj, (ptr.cast(), sel)) } @@ -312,7 +331,10 @@ impl MsgSendSuperRetained, Option>> impl MsgSendRetained>> for CopyOrMutCopy { #[inline] - unsafe fn send_message_id>>>( + unsafe fn send_message_retained< + A: ConvertArguments, + R: MaybeUnwrap>>, + >( obj: T, sel: Sel, args: A, @@ -332,7 +354,7 @@ impl MsgSendSuperRetained type Inner = T::Inner; #[inline] - unsafe fn send_super_message_id< + unsafe fn send_super_message_retained< A: ConvertArguments, R: MaybeUnwrap>>, >( @@ -341,9 +363,9 @@ impl MsgSendSuperRetained sel: Sel, args: A, ) -> R { - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { MsgSend::send_super_message(obj, superclass, sel, args) }; - // SAFETY: Same as in `send_message_id` + // SAFETY: Same as in `send_message_retained` let obj = unsafe { Retained::from_raw(obj) }; R::maybe_unwrap::(obj, ()) } @@ -351,7 +373,10 @@ impl MsgSendSuperRetained impl MsgSendRetained>> for Other { #[inline] - unsafe fn send_message_id>>>( + unsafe fn send_message_retained< + A: ConvertArguments, + R: MaybeUnwrap>>, + >( obj: T, sel: Sel, args: A, @@ -376,7 +401,7 @@ impl MsgSendSuperRetained>> for Ot type Inner = T::Inner; #[inline] - unsafe fn send_super_message_id< + unsafe fn send_super_message_retained< A: ConvertArguments, R: MaybeUnwrap>>, >( @@ -386,11 +411,11 @@ impl MsgSendSuperRetained>> for Ot args: A, ) -> R { let ptr = obj.into_raw_receiver(); - // SAFETY: Same as `send_message_id` + // SAFETY: Same as `send_message_retained` let obj = unsafe { MsgSend::send_super_message(ptr, superclass, sel, args) }; - // SAFETY: Same as `send_message_id` + // SAFETY: Same as `send_message_retained` let obj = unsafe { Retained::retain_autoreleased(obj) }; - // SAFETY: Same as `send_message_id` + // SAFETY: Same as `send_message_retained` R::maybe_unwrap::(obj, (unsafe { ptr.as_ref() }, sel)) } } @@ -539,7 +564,7 @@ mod tests { #[allow(dead_code)] trait Abc { - fn send_message_id(&self) {} + fn send_message_retained(&self) {} } impl Abc for T {} diff --git a/crates/objc2/src/macros/__method_msg_send.rs b/crates/objc2/src/macros/__method_msg_send.rs index eee0b8707..b1c3066ef 100644 --- a/crates/objc2/src/macros/__method_msg_send.rs +++ b/crates/objc2/src/macros/__method_msg_send.rs @@ -168,7 +168,7 @@ macro_rules! __method_msg_send_id { ($receiver) ($($retain_semantics)?) (MsgSendRetained) - (send_message_id) + (send_message_retained) ($sel) () } @@ -257,7 +257,7 @@ macro_rules! __method_msg_send_id { ($receiver) ($($retain_semantics)?) (MsgSendRetained) - (send_message_id) + (send_message_retained) ($($sel_parsed)*) ($($arg_parsed)*) } @@ -279,7 +279,7 @@ macro_rules! __method_msg_send_id { ($($retain_semantics)?) (MsgSendRetained) // Use error method - (send_message_id_error) + (send_message_retained_error) ($($sel_parsed)* $sel :) ($($arg_parsed)*) } diff --git a/crates/objc2/src/macros/__msg_send_parse.rs b/crates/objc2/src/macros/__msg_send_parse.rs index 1d0a04d87..5bd65d945 100644 --- a/crates/objc2/src/macros/__msg_send_parse.rs +++ b/crates/objc2/src/macros/__msg_send_parse.rs @@ -172,7 +172,7 @@ macro_rules! __comma_between_args { }; // msg_send_id! ( - (send_super_message_id_static) + (send_super_message_retained_static) ($($args:tt)*) ($obj:expr) () @@ -184,7 +184,7 @@ macro_rules! __comma_between_args { } }; ( - (send_super_message_id) + (send_super_message_retained) ($($args:tt)*) ($obj:expr, $superclass:expr) () @@ -196,7 +196,7 @@ macro_rules! __comma_between_args { } }; ( - (send_message_id) + (send_message_retained) ($($args:tt)*) ($obj:expr) () diff --git a/crates/objc2/src/macros/mod.rs b/crates/objc2/src/macros/mod.rs index 4635a2fd8..d068b6cab 100644 --- a/crates/objc2/src/macros/mod.rs +++ b/crates/objc2/src/macros/mod.rs @@ -1227,11 +1227,11 @@ macro_rules! msg_send_bool { macro_rules! msg_send_id { [super($obj:expr), $($selector_and_arguments:tt)+] => { $crate::__msg_send_parse! { - (send_super_message_id_static_error) + (send_super_message_retained_static_error) () () ($($selector_and_arguments)+) - (send_super_message_id_static) + (send_super_message_retained_static) ($crate::__msg_send_id_helper) ($obj) @@ -1241,11 +1241,11 @@ macro_rules! msg_send_id { }; [super($obj:expr, $superclass:expr), $($selector_and_arguments:tt)+] => { $crate::__msg_send_parse! { - (send_super_message_id_error) + (send_super_message_retained_error) () () ($($selector_and_arguments)+) - (send_super_message_id) + (send_super_message_retained) ($crate::__msg_send_id_helper) ($obj, $superclass) @@ -1255,7 +1255,7 @@ macro_rules! msg_send_id { }; [$obj:expr, new $(,)?] => ({ let result; - result = <$crate::__macro_helpers::New as $crate::__macro_helpers::MsgSendRetained<_, _>>::send_message_id( + result = <$crate::__macro_helpers::New as $crate::__macro_helpers::MsgSendRetained<_, _>>::send_message_retained( $obj, $crate::sel!(new), (), @@ -1264,12 +1264,12 @@ macro_rules! msg_send_id { }); [$obj:expr, alloc $(,)?] => ({ let result; - result = $crate::__macro_helpers::Alloc::send_message_id_alloc($obj); + result = $crate::__macro_helpers::Alloc::send_message_retained_alloc($obj); result }); [$obj:expr, init $(,)?] => ({ let result; - result = <$crate::__macro_helpers::Init as $crate::__macro_helpers::MsgSendRetained<_, _>>::send_message_id( + result = <$crate::__macro_helpers::Init as $crate::__macro_helpers::MsgSendRetained<_, _>>::send_message_retained( $obj, $crate::sel!(init), (), @@ -1278,11 +1278,11 @@ macro_rules! msg_send_id { }); [$obj:expr, $($selector_and_arguments:tt)+] => { $crate::__msg_send_parse! { - (send_message_id_error) + (send_message_retained_error) () () ($($selector_and_arguments)+) - (send_message_id) + (send_message_retained) ($crate::__msg_send_id_helper) ($obj) diff --git a/crates/test-assembly/crates/test_autorelease_return/lib.rs b/crates/test-assembly/crates/test_autorelease_return/lib.rs index 025b24471..195a3a212 100644 --- a/crates/test-assembly/crates/test_autorelease_return/lib.rs +++ b/crates/test-assembly/crates/test_autorelease_return/lib.rs @@ -11,6 +11,6 @@ fn simple(obj: Retained) -> *mut AnyObject { #[no_mangle] unsafe fn with_body(cls: &AnyClass, sel: Sel) -> *mut AnyObject { - let obj: Option> = New::send_message_id(cls, sel, ()); + let obj: Option> = New::send_message_retained(cls, sel, ()); Retained::autorelease_return(obj.unwrap_unchecked()) } diff --git a/crates/test-assembly/crates/test_msg_send_error/lib.rs b/crates/test-assembly/crates/test_msg_send_error/lib.rs index 838709bec..2d28548bb 100644 --- a/crates/test-assembly/crates/test_msg_send_error/lib.rs +++ b/crates/test-assembly/crates/test_msg_send_error/lib.rs @@ -12,22 +12,22 @@ unsafe fn error_bool(obj: &AnyObject, sel: Sel, param: u32) -> Result<()> { #[no_mangle] unsafe fn error_new(cls: &AnyClass, sel: Sel) -> Result> { - New::send_message_id_error(cls, sel, ()) + New::send_message_retained_error(cls, sel, ()) } // Note: Erroring allocation methods are intentionally not supported #[no_mangle] unsafe fn error_init(obj: Allocated, sel: Sel) -> Result> { - Init::send_message_id_error(obj, sel, ()) + Init::send_message_retained_error(obj, sel, ()) } #[no_mangle] unsafe fn error_copy(obj: &AnyObject, sel: Sel) -> Result> { - CopyOrMutCopy::send_message_id_error(obj, sel, ()) + CopyOrMutCopy::send_message_retained_error(obj, sel, ()) } #[no_mangle] unsafe fn error_autoreleased(obj: &AnyObject, sel: Sel) -> Result> { - Other::send_message_id_error(obj, sel, ()) + Other::send_message_retained_error(obj, sel, ()) } diff --git a/crates/test-assembly/crates/test_msg_send_retained/lib.rs b/crates/test-assembly/crates/test_msg_send_retained/lib.rs index 05e2e9bcc..33bac0e03 100644 --- a/crates/test-assembly/crates/test_msg_send_retained/lib.rs +++ b/crates/test-assembly/crates/test_msg_send_retained/lib.rs @@ -5,60 +5,60 @@ use objc2::runtime::{AnyClass, AnyObject, Sel}; #[no_mangle] unsafe fn handle_new(cls: &AnyClass, sel: Sel) -> Option> { - New::send_message_id(cls, sel, ()) + New::send_message_retained(cls, sel, ()) } #[no_mangle] unsafe fn handle_new_fallible(cls: &AnyClass, sel: Sel) -> Retained { - New::send_message_id(cls, sel, ()) + New::send_message_retained(cls, sel, ()) } #[no_mangle] unsafe fn handle_alloc(cls: &AnyClass, sel: Sel) -> Allocated { - Alloc::send_message_id(cls, sel, ()) + Alloc::send_message_retained(cls, sel, ()) } #[no_mangle] unsafe fn handle_init(obj: Allocated, sel: Sel) -> Option> { - Init::send_message_id(obj, sel, ()) + Init::send_message_retained(obj, sel, ()) } #[no_mangle] unsafe fn handle_init_fallible(obj: Allocated, sel: Sel) -> Retained { - Init::send_message_id(obj, sel, ()) + Init::send_message_retained(obj, sel, ()) } #[no_mangle] unsafe fn handle_alloc_init(cls: &AnyClass, sel1: Sel, sel2: Sel) -> Option> { - let obj = Alloc::send_message_id(cls, sel1, ()); - Init::send_message_id(obj, sel2, ()) + let obj = Alloc::send_message_retained(cls, sel1, ()); + Init::send_message_retained(obj, sel2, ()) } #[no_mangle] unsafe fn handle_alloc_release(cls: &AnyClass, sel: Sel) { - let _obj: Allocated = Alloc::send_message_id(cls, sel, ()); + let _obj: Allocated = Alloc::send_message_retained(cls, sel, ()); } #[no_mangle] unsafe fn handle_alloc_init_release(cls: &AnyClass, sel1: Sel, sel2: Sel) { - let obj = Alloc::send_message_id(cls, sel1, ()); - let obj: Option> = Init::send_message_id(obj, sel2, ()); + let obj = Alloc::send_message_retained(cls, sel1, ()); + let obj: Option> = Init::send_message_retained(obj, sel2, ()); let _obj = obj.unwrap_unchecked(); } #[no_mangle] unsafe fn handle_copy(obj: &AnyObject, sel: Sel) -> Option> { - CopyOrMutCopy::send_message_id(obj, sel, ()) + CopyOrMutCopy::send_message_retained(obj, sel, ()) } #[no_mangle] unsafe fn handle_copy_fallible(obj: &AnyObject, sel: Sel) -> Retained { - CopyOrMutCopy::send_message_id(obj, sel, ()) + CopyOrMutCopy::send_message_retained(obj, sel, ()) } #[no_mangle] unsafe fn handle_autoreleased(obj: &AnyObject, sel: Sel) -> Option> { - Other::send_message_id(obj, sel, ()) + Other::send_message_retained(obj, sel, ()) } // TODO: The optimization does not happen here on aarch64, fix this! @@ -68,12 +68,12 @@ unsafe fn handle_autoreleased_with_arg( sel: Sel, arg: u8, ) -> Option> { - Other::send_message_id(obj, sel, (arg,)) + Other::send_message_retained(obj, sel, (arg,)) } #[no_mangle] unsafe fn handle_autoreleased_fallible(obj: &AnyObject, sel: Sel) -> Retained { - Other::send_message_id(obj, sel, ()) + Other::send_message_retained(obj, sel, ()) } // TODO: The optimization does not happen here, fix this! @@ -83,5 +83,5 @@ unsafe fn handle_with_out_param( sel: Sel, param: &mut Retained, ) -> Option> { - Other::send_message_id(obj, sel, (param,)) + Other::send_message_retained(obj, sel, (param,)) } diff --git a/crates/test-ui/ui/extern_methods_invalid_receiver.stderr b/crates/test-ui/ui/extern_methods_invalid_receiver.stderr index c4182981b..dc12999df 100644 --- a/crates/test-ui/ui/extern_methods_invalid_receiver.stderr +++ b/crates/test-ui/ui/extern_methods_invalid_receiver.stderr @@ -17,8 +17,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::__rewrite_self_param_inner` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types @@ -40,8 +40,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::__rewrite_self_param_inner` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) help: use the `?` operator to extract the `Option>` value, propagating an `Option::None` value to the caller --> $WORKSPACE/crates/objc2/src/macros/__rewrite_self_param.rs diff --git a/crates/test-ui/ui/extern_methods_invalid_type.stderr b/crates/test-ui/ui/extern_methods_invalid_type.stderr index b7cf2b442..3a8513219 100644 --- a/crates/test-ui/ui/extern_methods_invalid_type.stderr +++ b/crates/test-ui/ui/extern_methods_invalid_type.stderr @@ -46,11 +46,11 @@ error[E0277]: the trait bound `i32: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Box: Encode` is not satisfied @@ -135,11 +135,11 @@ error[E0277]: the trait bound `Result, Retained>: M Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `MainThreadMarker: ConvertReturn` is not satisfied diff --git a/crates/test-ui/ui/msg_send_alloc_init_different.stderr b/crates/test-ui/ui/msg_send_alloc_init_different.stderr index de451fb64..64fef5d8f 100644 --- a/crates/test-ui/ui/msg_send_alloc_init_different.stderr +++ b/crates/test-ui/ui/msg_send_alloc_init_different.stderr @@ -6,9 +6,9 @@ error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Inp | = note: expected enum `Option>` found enum `Option>` -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/test-ui/ui/msg_send_invalid_error.stderr b/crates/test-ui/ui/msg_send_invalid_error.stderr index 8c8422f45..28eab4632 100644 --- a/crates/test-ui/ui/msg_send_invalid_error.stderr +++ b/crates/test-ui/ui/msg_send_invalid_error.stderr @@ -132,14 +132,14 @@ error[E0271]: type mismatch resolving `> as MaybeUnwrap>::Inp | = note: expected struct `Allocated<_>` found enum `Option>` -note: required by a bound in `send_message_id_error` +note: required by a bound in `send_message_retained_error` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id_error(obj: T, sel: Sel, args: A) -> Result> - | --------------------- required by a bound in this associated function + | unsafe fn send_message_retained_error( + | --------------------------- required by a bound in this associated function ... | Option: MaybeUnwrap, - | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id_error` + | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained_error` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types diff --git a/crates/test-ui/ui/msg_send_invalid_receiver.stderr b/crates/test-ui/ui/msg_send_invalid_receiver.stderr index eccaea433..57b61183e 100644 --- a/crates/test-ui/ui/msg_send_invalid_receiver.stderr +++ b/crates/test-ui/ui/msg_send_invalid_receiver.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^^^^^^^^^^^^^^^ + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> ui/msg_send_invalid_receiver.rs @@ -29,8 +29,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> ui/msg_send_invalid_receiver.rs @@ -46,8 +46,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> ui/msg_send_invalid_receiver.rs @@ -63,8 +63,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> ui/msg_send_invalid_receiver.rs @@ -80,8 +80,8 @@ error[E0308]: mismatched types note: associated function defined here --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^ + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `Retained: MessageReceiver` is not satisfied --> ui/msg_send_invalid_receiver.rs diff --git a/crates/test-ui/ui/msg_send_invalid_return.stderr b/crates/test-ui/ui/msg_send_invalid_return.stderr index 98e779a3d..46a421674 100644 --- a/crates/test-ui/ui/msg_send_invalid_return.stderr +++ b/crates/test-ui/ui/msg_send_invalid_return.stderr @@ -8,11 +8,11 @@ error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `AnyClass: Message` is not satisfied @@ -55,11 +55,11 @@ error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` +note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `AnyClass: Message` is not satisfied @@ -74,11 +74,11 @@ error[E0277]: the trait bound `AnyClass: Message` is not satisfied NSObject ProtocolObject

__NSProxy -note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` +note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Input == Allocated<_>` @@ -89,11 +89,11 @@ error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Inp | = note: expected struct `Allocated<_>` found enum `Option>` -note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` +note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Option>: MaybeUnwrap` is not satisfied @@ -103,11 +103,11 @@ error[E0277]: the trait bound `Option>: MaybeUnwrap` is not | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MaybeUnwrap` is not implemented for `Option>` | = help: the trait `MaybeUnwrap` is implemented for `Option>` -note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` +note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0271]: type mismatch resolving `> as MaybeUnwrap>::Input == Allocated<_>` @@ -118,11 +118,11 @@ error[E0271]: type mismatch resolving `> as MaybeU | = note: expected struct `Allocated<_>` found enum `Option>>` -note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` +note: required by a bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | pub unsafe fn send_message_id_alloc>>( - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_id_alloc` + | pub unsafe fn send_message_retained_alloc>>( + | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `__macro_helpers::msg_send_retained::>::send_message_retained_alloc` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied @@ -135,11 +135,11 @@ error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Input == Option>` @@ -150,11 +150,11 @@ error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Inpu | = note: expected enum `Option>` found enum `Option>` -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Input == Option>` @@ -165,11 +165,11 @@ error[E0271]: type mismatch resolving ` as MaybeUnwrap>::Inpu | = note: expected enum `Option>` found enum `Option>` -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied @@ -182,11 +182,11 @@ error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied @@ -199,11 +199,11 @@ error[E0277]: the trait bound `&AnyObject: MaybeUnwrap` is not satisfied Allocated Option> Retained -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Option<&AnyObject>: MaybeUnwrap` is not satisfied @@ -213,9 +213,9 @@ error[E0277]: the trait bound `Option<&AnyObject>: MaybeUnwrap` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MaybeUnwrap` is not implemented for `Option<&AnyObject>` | = help: the trait `MaybeUnwrap` is implemented for `Option>` -note: required by a bound in `send_message_id` +note: required by a bound in `send_message_retained` --> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send_retained.rs | - | unsafe fn send_message_id>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_id` + | unsafe fn send_message_retained>( + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MsgSendRetained::send_message_retained` = note: this error originates in the macro `$crate::__msg_send_id_helper` which comes from the expansion of the macro `msg_send_id` (in Nightly builds, run with -Z macro-backtrace for more info)