pymodule, pyattr, pyclass, pygetset, and pymethod attrs generate numerous errors related to rustpython_vm when used
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci l’esempio documentato Rust-from-Python ed esegui cargo clippy, concentrandoti su src/plugins.rs e sull’espansione della macro di rustpython-derive 0.4.0 mostrata nella diagnostica. Confronta il modo in cui pymodule, pyclass, pyattr, pygetset e pymethod risolvono rustpython_vm; il lavoro è completato quando l’esempio compila e crea un modulo RustPython senza questi errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Using the exact code provided on https://rustpython.github.io/docs/interop/rust_from_python.html generates a lot of errors
Expected
It functions and creates a rustpython module.
Actual
[arthur@fullworld][~/notation]% RUSTFLAGS="-Zmacro-backtrace" cargo clippy [git][git/.][main]
Checking notation v1.0.0 (/home/arthur/notation)
error: #[pyclass(...)] doesn't contain 'no_attr' to remove
--> src/plugins.rs:50:7
|
50 | #[pyclass]
| ^^^^^^^
error[E0432]: unresolved import `rustpython_vm`
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| help: a similar path exists: `super::rustpython_vm`
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
error: cannot find attribute `pyclass` in this scope
--> src/plugins.rs:55:7
|
55 | #[pyclass]
| ^^^^^^^
|
help: consider importing this attribute macro
|
42 + use crate::plugins::rustpython_vm::pyclass;
|
error: cannot find attribute `pygetset` in this scope
--> src/plugins.rs:57:11
|
57 | #[pygetset]
| ^^^^^^^^
error: cannot find attribute `pymethod` in this scope
--> src/plugins.rs:62:11
|
62 | #[pymethod]
| ^^^^^^^^
error: cannot find attribute `pyattr` in this scope
--> src/plugins.rs:49:7
|
49 | #[pyattr]
| ^^^^^^
error: cannot find attribute `pyclass` in this scope
--> src/plugins.rs:50:7
|
50 | #[pyclass]
| ^^^^^^^
|
help: consider importing this attribute macro
|
42 + use crate::plugins::rustpython_vm::pyclass;
|
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: consider importing this crate through its public re-export
|
42 + use crate::plugins::rustpython_vm;
|
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: consider importing this module
|
42 + use crate::plugins::rustpython_vm::builtins;
|
error[E0425]: cannot find value `DEF` in this scope
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| not found in this scope
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: consider importing one of these modules
|
42 + use crate::plugins::rustpython_stdlib::builtins;
|
42 + use crate::plugins::rustpython_vm::builtins;
|
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: consider importing this struct
|
42 + use crate::plugins::rustpython_vm::builtins::PyModule;
|
error[E0433]: failed to resolve: could not find `rustpython_vm` in the list of imported crates
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| could not find `rustpython_vm` in the list of imported crates
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: consider importing this module
|
42 + use crate::plugins::rustpython_vm::function;
|
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustpython_vm`
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| use of unresolved module or unlinked crate `rustpython_vm`
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: there is a crate or module with a similar name
|
39 - #[pymodule]
39 + rustpython
|
help: consider importing this struct
|
42 + use crate::plugins::rustpython_vm::function::PyMethodDef;
|
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustpython_vm`
--> src/plugins.rs:39:1
|
39 | #[pymodule]
| ^^^^^^^^^^^
| |
| use of unresolved module or unlinked crate `rustpython_vm`
| in this attribute macro expansion
|
::: /home/arthur/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustpython-derive-0.4.0/src/lib.rs:38:1
|
38 | pub fn pymodule(attr: TokenStream, item: TokenStream) -> TokenStream {
| -------------------------------------------------------------------- in this expansion of `#[pymodule]`
|
help: there is a crate or module with a similar name
|
39 - #[pymodule]
39 + rustpython
|
help: consider importing this struct
|
42 + use crate::plugins::rustpython_vm::function::PyMethodFlags;
|
Some errors have detailed explanations: E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `notation` (bin "notation") due to 16 previous errors
Python Documentation
N/A
- Lingua principale
- Rust
- Stelle
- 22.4k
- Fork
- 1.5k
- Merge medio
- 14h 42m
- PR unite (30g)
- 174
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RustPython/RustPython
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
RustPython/RustPython#8470 · 2 commenti ·
-
C-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
RustPython/RustPython#7995 · 5 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
RustPython/RustPython#5577 ·
-
C-bug z-ca-2026
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
RustPython/RustPython#8765 · 1 reazione ·
-
C-bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
RustPython/RustPython#8764 ·
Tutte le issue di RustPython/RustPython
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Accept -c in more positions Apertaarea: compat bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
area:ci enhancement requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/datafusion-comet#6078 ·
-
area: dogs bug priority: P3 silent failure test-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100