diff --git a/objc2/src/macros.rs b/objc2/src/macros.rs index b01ff1963..0f81c0cc9 100644 --- a/objc2/src/macros.rs +++ b/objc2/src/macros.rs @@ -876,7 +876,9 @@ macro_rules! __msg_send_helper { let result; // Always add trailing comma after each argument, so that we get a // 1-tuple if there is only one. - result = $crate::MessageReceiver::$fn($($fn_args)+, $crate::sel!($($selector)*), ($($argument,)*)); + // + // And use `::<_, _>` for better UI + result = $crate::MessageReceiver::$fn::<_, _>($($fn_args)+, $crate::sel!($($selector)*), ($($argument,)*)); result }); } @@ -1135,7 +1137,7 @@ macro_rules! __msg_send_id_helper { let result; result = <$crate::__macro_helpers::RetainSemantics<{ $crate::__macro_helpers::retain_semantics(__SELECTOR_DATA) - }> as $crate::__macro_helpers::MsgSendId<_, _>>::$fn( + }> as $crate::__macro_helpers::MsgSendId<_, _>>::$fn::<_, _>( $obj, $crate::__sel_inner!( __SELECTOR_DATA, diff --git a/test-ui/ui/msg_send_underspecified_error.stderr b/test-ui/ui/msg_send_underspecified_error.stderr index e852982ca..cd33ae828 100644 --- a/test-ui/ui/msg_send_underspecified_error.stderr +++ b/test-ui/ui/msg_send_underspecified_error.stderr @@ -5,11 +5,6 @@ error[E0282]: type annotations needed | ^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `E` declared on the associated function `__send_message_error` | = note: this error originates in the macro `$crate::__msg_send_helper` which comes from the expansion of the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider specifying the generic arguments - --> $WORKSPACE/objc2/src/macros.rs - | - | @(__send_message_error::<(), E>) - | +++++++++ error[E0283]: type annotations needed --> ui/msg_send_underspecified_error.rs