Skip to content

Fix non_local_definitions warnings from RFC 3373 #3903

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
davidhewitt opened this issue Feb 26, 2024 · 1 comment · Fixed by #3955
Closed

Fix non_local_definitions warnings from RFC 3373 #3903

davidhewitt opened this issue Feb 26, 2024 · 1 comment · Fixed by #3955

Comments

@davidhewitt
Copy link
Member

Follow up to #3901

I will leave FIXME places in the code where the #[allow(non_local_definitions)] lint is firing. Broadly I think this lint falls into two camps:

  • We use const _: () = { use ::pyo3 as _pyo3; /* macro expanded code */ } to allow use-ing PyO3 at a consistent name across the PyO3 codebase. This was convenient to support the #[pyo3(crate = "...")] option. I think we could refactor the macros to not need this anonymous const, and that might solve the problem.
  • Inside create_exception! and its inner macros we have implementations of traits for &MyCustomException, which the lint seems to not like. We may be able to remove these cases alongside the GIL Ref API.
@mejrs
Copy link
Member

mejrs commented Feb 27, 2024

I'll have a crack at this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants