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

Make Id #[fundamental] #50

Closed
wants to merge 2 commits into from
Closed

Make Id #[fundamental] #50

wants to merge 2 commits into from

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Oct 29, 2021

Proof-of-concept on fixing the remaining part of #41, identified in #39 (upstream SSheldon/rust-objc-foundation#1). Probably a better alternative than #48.

The #[fundamental] attribute is unstable, see RFC 1023 and tracking issue, so I won't merge this.

@madsmtm madsmtm added the enhancement New feature or request label Oct 29, 2021
@madsmtm madsmtm mentioned this pull request Nov 3, 2021
80 tasks
@madsmtm madsmtm mentioned this pull request Mar 2, 2022
@madsmtm madsmtm added this to the objc2 v0.3 milestone Apr 2, 2022
This changes the coherence rules to give Id less flexibility in terms of forwards compatibility, but in return allowing downstream crates (like objc2_foundation) to implement From for this type.

Requires feature flag unstable-id-fundamental
@madsmtm
Copy link
Owner Author

madsmtm commented Jun 16, 2022

So it turns out that since #150, we can't actually use this feature any more, it prevents us from implementing MessageReceiver for Id since downstream crates could impl Message for Id<TheirType, O> (which would be completely against the unsafe contract, but Rust can't know that!).

Hence I'll close this, if we find it to be a big issue we can always just use newtypes, like NSArray<T>(Id<NSArrayInner<T>, Shared>) if need be!

@madsmtm madsmtm closed this Jun 16, 2022
@madsmtm madsmtm deleted the id-fundamental branch June 16, 2022 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant