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

sel! can no longer be specifically macro_used in versions 0.2.3+ #69

Open
daniel-abramov opened this issue Jul 24, 2018 · 5 comments
Open

Comments

@daniel-abramov
Copy link

The version 0.2.3 has introduced some changes in the way sel!() is implemented, along with the new sel_impl macro. The changes are indeed backward compatible, but only if the crate which uses objc import all macros. However if the library uses objc and imports the macros in the following way:

#[macro_use(msg_send, sel)]
extern crate objc;

then an update from 0.2.2 to 0.2.3 will produce a compile-time error (sel_impl cannot be found).

Could we consider that the change introduced in 0.2.3 is a breaking change and does it make sense to bump the minor version instead of a patch version, so that if somebody does not experience an unexpected compile time error after updating 0.2.2 to 0.2.3?

@SSheldon
Copy link
Owner

@application-developer-DA hmm that's a case I hadn't considered. Is this impacting your project? Do you know of any others and how widespread this is?

@SSheldon
Copy link
Owner

@daniel-abramov
Copy link
Author

@SSheldon the issue affected the project on which I work in the company, I spot the issue and fixed it (the fix was trivial after I checked the repository, changelog and commits for 2.2.3), but I decided to inform you about the issue so that you can decide whether or not to "fix" it and also as a reference for the ones who might have the same problem.

@SSheldon
Copy link
Owner

Thanks for the heads up :)

I could look into refactoring the macro to remove the need for sel_impl!, but if you've added it to your macro_use list, that'd just be a breaking change for you again! Wish there was a nicer way to share code in macros...

Sounds like the damage might be done already. Will keep an eye out for it in the future, and knowing about this should make it easy to help out if anyone else runs into the issue.

@mehcode
Copy link
Contributor

mehcode commented Aug 3, 2018

@SSheldon Read through rust-lang/rust#35896 (comment)


From what I understand, you want to mark internal macros as #[macro_export(local_inner_macros)]. This will let #[macro_use(sel)] work as expected in Rust2015 and as expected in Rust2018 as use objc::sel.

@SSheldon SSheldon changed the title Should not the changes introduced in 0.2.3 increase the version to 0.3.0? sel! can no longer be specifically macro_used in versions 0.2.3+ Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants