Skip to content

Commit

Permalink
Slightly improve msg_send! error UI
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Oct 28, 2022
1 parent a3faaea commit 88d1b83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 4 additions & 2 deletions objc2/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions test-ui/ui/msg_send_underspecified_error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88d1b83

Please sign in to comment.