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

Fix the #[macro_export] absolute path within the same crate issue #2045

Closed

Conversation

danielhenrymantilla
Copy link
Contributor

@danielhenrymantilla danielhenrymantilla commented Dec 8, 2021

This takes care of https://github.com/PyO3/pyo3/runs/4455431379?check_suite_focus=true, reported in #2022 (comment) (cc @mejrs, @birkenfeld), by applying one of the workarounds suggested in rust-lang/rust#52234 (comment). Mainly the one where, because we are the only callers of the meta-macro, and because we are located in a non root-of-the-crate module, to append a pub use macro_exported_macro; right after its definition, so that the fully qualified path ($crate::path::to::non_root_module::macro_exported_macro;) works even when within the crate where the export occurs 🙂

@birkenfeld birkenfeld force-pushed the pyo3_path branch 2 times, most recently from 6bd01c8 to 2d49dc3 Compare December 9, 2021 06:36
@davidhewitt
Copy link
Member

Brilliant find, thanks very much! I'm going to close this one as the commit has been added into #2022 and is working nicely. 👍

@davidhewitt davidhewitt closed this Dec 9, 2021
@danielhenrymantilla danielhenrymantilla deleted the pyo3_path branch December 9, 2021 11:00
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

Successfully merging this pull request may close these issues.

3 participants