-
Notifications
You must be signed in to change notification settings - Fork 63
add unstable-core-darwin-objc feature #761
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
Conversation
68abe05
to
89aebd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm probably going to wait with merging this until there's at least a rust-lang/rust PR open that we can point people towards.
I added support for the I wonder if my |
I made |
Re identifier vs. string literal: I tend to think the They aren't even limited to UTF-8, so might actually make sense to force c-string literals, to prevent interior NUL bytes by construction? |
I'd be ok with string literals only. C-string literals only would make |
EDIT: Only |
Both good points, then a normal string literal is probably fine. |
Done. They now expect string literals and are used in new implementations of Though now I'm wondering if I should change |
The rustc feature plan has changed slightly. See rust-lang/rust#145496. I'll revisit this PR once we make more progress on the rustc changes. |
619c1a4
to
043ae79
Compare
a2990b0
to
5534291
Compare
Updated now that I tested with |
6710d52
to
6afc191
Compare
@madsmtm is there anything else you'd like to see before this gets merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only have a few smaller things, am otherwise happy with this as-is.
If you don't get to it within the next few days, I'll probably fix it myself, I'd like to get the framework crate parts out with v0.3.2.
examples/audio/Cargo.toml
Outdated
path = "speech_synthesis.rs" | ||
|
||
[features] | ||
unstable-core-darwin-objc = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The examples actually can use:
unstable-core-darwin-objc = [] | |
unstable-core-darwin-objc = ["objc2/unstable-core-darwin-objc", "objc2-foundation/unstable-core-darwin-objc"] |
Because we don't ship them anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left them out because running cargo run --example <name here> --features unstable-core-darwin-objc
seemed to enable it in all the dependencies implicitly. I'm no cargo expert, though, so I defer to you on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but it doesn't happen if you do cargo run -pexamples-audio --example speech_synthesis --features unstable-core-darwin-objc
(or you are cd-ed into examples/audio
). I went and added it.
crates/objc2/Cargo.toml
Outdated
# | ||
# Please test it, and report any issues you may find: | ||
# https://github.com/madsmtm/objc2/issues/new | ||
unstable-core-darwin-objc = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd prefer this was named something more descriptive, maybe unstable-static-via-rustc
, unstable-static-nightly
or unstable-static-proper
? At the very least, it should have static
in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we make it so that unstable-core-darwin-objc
augments unstable-static-sel
/unstable-static-class
(so you need to enable all three).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the augmentation approach since in most of the crates all this feature does is enable the darwin_objc
language feature. Maybe unstable-rustc-darwin-objc
is a better name?
I'm a little busy this weekend so feel free to take over if you want it sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it to just unstable-darwin-objc
(since that is the name of the feature in the compiler), and went with the augmentation route.
There isn't stability issues with this, since we don't ship the examples. And this more clearly shows what users would want to do.
Instead of overriding.
I went and implemented the things I suggested myself, thanks again for your work here! |
6afc191
to
f9490f8
Compare
No problem, thanks for all your help! |
Uses the
darwin_objc
(rust-lang/rust#145496) language feature.