You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been maintaining a rather large PyO3/maturin project for a number of years now. Recently, after updating things, I have started to receive a very large number of warnings when compiling the project that look something like this:
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> src/data_structures/point3d.rs:14:1
|
14 | #[pymethods]
| -^^^^^^^^^^^
| |
| `PyClassImplCollector` is not local
| `PyClassNewTextSignature` is not local
| move the `impl` block outside of this function `trampoline` and up 4 bodies
15 | impl Point3D {
| -------
| |
| `Point3D` is not local
| `Point3D` is not local
|
= note: the attribute macro `pymethods` defines the non-local `impl`, and may need to be changed
= note: the attribute macro `pymethods` may come from an old version of the `pyo3_macros` crate, try updating your dependency with `cargo update -p pyo3_macros`
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: this warning originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
I don't fully understand the issue, as the Point3D impl in the example warning above is located in the same file as the structure. I've tried looking this issue up but unfortunately I can't understand any of the explanations for the nature of the problem on any of the Github issues that I've come across and I don't see any obvious resolution to the problem. Any insights? Has anyone else run into this problem?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been maintaining a rather large PyO3/maturin project for a number of years now. Recently, after updating things, I have started to receive a very large number of warnings when compiling the project that look something like this:
I don't fully understand the issue, as the
Point3D
impl in the example warning above is located in the same file as the structure. I've tried looking this issue up but unfortunately I can't understand any of the explanations for the nature of the problem on any of the Github issues that I've come across and I don't see any obvious resolution to the problem. Any insights? Has anyone else run into this problem?Beta Was this translation helpful? Give feedback.
All reactions