Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove c_void encoding hack #535

Merged
merged 2 commits into from
Dec 3, 2023
Merged

Remove c_void encoding hack #535

merged 2 commits into from
Dec 3, 2023

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Dec 3, 2023

This was in theory useful back when references to c_void were of higher likelihood, but nowadays I doubt it'll ever be an issue.

Fixes #511.

@madsmtm madsmtm added bug Something isn't working A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates labels Dec 3, 2023
Comment on lines -7 to -26
error[E0283]: type annotations needed
--> ui/msg_send_underspecified_error.rs
|
| let _: Result<(), _> = unsafe { msg_send![obj, a: _] };
| ^^^^^^^^^^^^^^^^^^^^ cannot infer type for raw pointer `*mut _`
|
= note: multiple `impl`s satisfying `*mut _: RefEncode` found in the `objc2` crate:
- impl RefEncode for *mut c_void;
- impl<T> RefEncode for *mut T
where T: RefEncode, T: ?Sized;
= note: required for `*mut *mut _` to implement `Encode`
note: required by a bound in `send_message_error`
--> $WORKSPACE/crates/objc2/src/__macro_helpers/msg_send.rs
|
| unsafe fn send_message_error<A, E>(self, sel: Sel, args: A) -> Result<(), Id<E>>
| ------------------ required by a bound in this associated function
| where
| *mut *mut E: Encode,
| ^^^^^^ required by this bound in `MsgSend::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)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may seem unfortunate that we're now missing this information, but in reality it's not actually helpful for the user.

@madsmtm madsmtm merged commit aa67e05 into master Dec 3, 2023
19 checks passed
@madsmtm madsmtm deleted the c-void-encoding branch December 3, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using AtomicPtr as ivar
1 participant