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

use new (1.30.0) stable rust feature #[macro_export(local_inner_macros)] #159

Closed
softprops opened this issue Oct 26, 2018 · 6 comments
Closed

Comments

@softprops
Copy link
Contributor

announced here rust is updating the way users access exported macros and the way macro authors export them noted in the release notes

You can now import and reexport macros from other crates with the use syntax. Macros exported with #[macro_export] are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the #[macro_export(local_inner_macros)] attribute so users won't have to import those macros.

pending docs for this feature live here

I've started experimenting with this in the rust crowbar crate but have found that in practice it may require this crate to use the local_inner_macros way of exporting macros so crowbar users won't have to use this crates helper macros explicitly iliana/rust-crowbar#46 (comment)

@softprops
Copy link
Contributor Author

since there are so many of these it may be just as simple to use the new $crate:: path references within macro definitions.

@softprops
Copy link
Contributor Author

for reference rust >= 1.30.0 will handle $crate:: for both rust editions. local_inner_macros is for older versions of rust. I see you have a older versions 1.25 in your travis.yml any interest in making 1.30 the new default @dgrunwald ?

@softprops
Copy link
Contributor Author

@dgrunwald I don't mean to be a bother, but I noticed there are some passing prs with no activity in this repo since 2017. Is this repo still actively maintained?

@dgrunwald
Copy link
Owner

@softprops No, it's not really maintained anymore.

Probably most of the macro stuff should be re-done using procedural macros instead; especially py_class! is way too complex currently and the error messages from macro_rules are useless.

@softprops
Copy link
Contributor Author

@dgrunwald that's for the response. Context for my interest here is I'm trying to work with the maintainer of the rust crowbar crate move forward with the newly stable macro features but it depended on this crate so I reached out. I'll see what we can do!

@richard-uk1
Copy link
Contributor

I have a PR that makes it work with 2018 edition: #167.

@markbt markbt closed this as completed Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants