[INFO] fetching crate python-ast 1.0.2... [INFO] linting python-ast-1.0.2 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate python-ast 1.0.2 into /workspace/builds/worker-2-tc1/source [INFO] started tweaking crates.io crate python-ast 1.0.2 [INFO] removed 0 missing examples [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate python-ast 1.0.2 [INFO] tweaked toml for crates.io crate python-ast 1.0.2 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate python-ast 1.0.2 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate python-ast 1.0.2 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded test-log-macros v0.2.18 [INFO] [stderr] Downloaded iter-read v1.1.0 [INFO] [stderr] Downloaded to_tokenstream v0.1.3 [INFO] [stderr] Downloaded test-log v0.2.18 [INFO] [stderr] Downloaded pyo3-macros v0.25.1 [INFO] [stderr] Downloaded pythonize v0.25.0 [INFO] [stderr] Downloaded litrs v0.5.1 [INFO] [stderr] Downloaded pyo3-build-config v0.25.1 [INFO] [stderr] Downloaded pyo3-macros-backend v0.25.1 [INFO] [stderr] Downloaded serde-pickle v1.2.0 [INFO] [stderr] Downloaded pyo3-ffi v0.25.1 [INFO] [stderr] Downloaded pyo3 v0.25.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 8422776a9160985ddecd251775c3628215bb3bd911015e928e42638cd853dc0e [INFO] running `Command { std: "docker" "start" "-a" "8422776a9160985ddecd251775c3628215bb3bd911015e928e42638cd853dc0e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8422776a9160985ddecd251775c3628215bb3bd911015e928e42638cd853dc0e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8422776a9160985ddecd251775c3628215bb3bd911015e928e42638cd853dc0e", kill_on_drop: false }` [INFO] [stdout] 8422776a9160985ddecd251775c3628215bb3bd911015e928e42638cd853dc0e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 692876fc2517e7c12a77e22c991247eb5fbb5f5c89a54852815f2c0721015586 [INFO] running `Command { std: "docker" "start" "-a" "692876fc2517e7c12a77e22c991247eb5fbb5f5c89a54852815f2c0721015586", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Compiling target-lexicon v0.13.2 [INFO] [stderr] Checking encoding_index_tests v0.1.4 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Checking anstyle v1.0.11 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking anstyle-query v1.1.3 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking unindent v0.2.4 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Checking iter-read v1.1.0 [INFO] [stderr] Checking litrs v0.5.1 [INFO] [stderr] Checking encoding-index-japanese v1.20141219.5 [INFO] [stderr] Checking encoding-index-korean v1.20141219.5 [INFO] [stderr] Checking encoding-index-tradchinese v1.20141219.5 [INFO] [stderr] Checking encoding-index-singlebyte v1.20141219.5 [INFO] [stderr] Checking encoding-index-simpchinese v1.20141219.5 [INFO] [stderr] Checking anstream v0.6.19 [INFO] [stderr] Checking encoding v0.2.33 [INFO] [stderr] Checking quote v1.0.40 [INFO] [stderr] Checking to_tokenstream v0.1.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Compiling syn v2.0.104 [INFO] [stderr] Compiling pyo3-build-config v0.25.1 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling pyo3-macros-backend v0.25.1 [INFO] [stderr] Compiling pyo3-ffi v0.25.1 [INFO] [stderr] Compiling pyo3 v0.25.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking env_filter v0.1.3 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling test-log-macros v0.2.18 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling num-derive v0.4.2 [INFO] [stderr] Checking test-log v0.2.18 [INFO] [stderr] Checking thiserror v2.0.12 [INFO] [stderr] Compiling pyo3-macros v0.25.1 [INFO] [stderr] Checking serde-pickle v1.2.0 [INFO] [stderr] Checking pythonize v0.25.0 [INFO] [stderr] Checking python-ast v1.0.2 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | targets: targets, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `targets` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:61:25 [INFO] [stdout] | [INFO] [stdout] 61 | position: position, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/bool_ops.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | op: op, [INFO] [stdout] | ^^^^^^ help: replace it with: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/compare.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | comparators: comparators, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `comparators` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/expression.rs:507:13 [INFO] [stdout] | [INFO] [stdout] 507 | ctx: ctx, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ctx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/ast/tree/import.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / /// 2. Causes the referenced module to be compiled into the program (only once). [INFO] [stdout] 23 | | [INFO] [stdout] | |_^ [INFO] [stdout] 24 | impl CodeGen for Import { [INFO] [stdout] | - the comment documents this implementation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/unary_op.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | op: op, [INFO] [stdout] | ^^^^^^ help: replace it with: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | targets: targets, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `targets` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/assign.rs:61:25 [INFO] [stdout] | [INFO] [stdout] 61 | position: position, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/datamodel/class.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / /// Returns the method resolution order of the class. [INFO] [stdout] 10 | | //fn mro(&self) -> Box>>; [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 14 | fn __new__() -> Self { [INFO] [stdout] | ---------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `__new__` then comment it out [INFO] [stdout] | [INFO] [stdout] 9 | // /// Returns the method resolution order of the class. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/macros.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / /// Macros for reducing code duplication in the python-ast library. [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 6 | macro_rules! impl_from_py_object_for_op_enum { [INFO] [stdout] | -------------------------------------------- the comment documents this macro definition [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 - /// Macros for reducing code duplication in the python-ast library. [INFO] [stdout] 1 + //! Macros for reducing code duplication in the python-ast library. [INFO] [stdout] | [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 2 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `crate` references the macro call's crate [INFO] [stdout] --> src/macros.rs:134:26 [INFO] [stdout] | [INFO] [stdout] 134 | let result = crate::parse($code, $file_name).unwrap(); [INFO] [stdout] | ^^^^^ help: to reference the macro definition's crate, use: `$crate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def [INFO] [stdout] = note: `#[warn(clippy::crate_in_macro_def)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/parser_utils.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / /// Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | use pyo3::{Bound, PyAny, PyResult, prelude::PyAnyMethods, types::PyTypeMethods}; [INFO] [stdout] | - the comment documents this `use` import [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 - /// Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] 1 + //! Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/parser_utils.rs:196:1 [INFO] [stdout] | [INFO] [stdout] 196 | / /// Enhanced error handling utilities for parsing Python AST objects [INFO] [stdout] 197 | | [INFO] [stdout] | |_^ [INFO] [stdout] 198 | /// Get an attribute from a Python object with better error messaging [INFO] [stdout] 199 | pub fn get_attr_with_context<'a>( [INFO] [stdout] | ---------------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 197 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/bool_ops.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | op: op, [INFO] [stdout] | ^^^^^^ help: replace it with: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/compare.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | comparators: comparators, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `comparators` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/expression.rs:507:13 [INFO] [stdout] | [INFO] [stdout] 507 | ctx: ctx, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ctx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/ast/tree/import.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / /// 2. Causes the referenced module to be compiled into the program (only once). [INFO] [stdout] 23 | | [INFO] [stdout] | |_^ [INFO] [stdout] 24 | impl CodeGen for Import { [INFO] [stdout] | - the comment documents this implementation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/tree/unary_op.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | op: op, [INFO] [stdout] | ^^^^^^ help: replace it with: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/datamodel/class.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / /// Returns the method resolution order of the class. [INFO] [stdout] 10 | | //fn mro(&self) -> Box>>; [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 14 | fn __new__() -> Self { [INFO] [stdout] | ---------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `__new__` then comment it out [INFO] [stdout] | [INFO] [stdout] 9 | // /// Returns the method resolution order of the class. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/macros.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / /// Macros for reducing code duplication in the python-ast library. [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 6 | macro_rules! impl_from_py_object_for_op_enum { [INFO] [stdout] | -------------------------------------------- the comment documents this macro definition [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 - /// Macros for reducing code duplication in the python-ast library. [INFO] [stdout] 1 + //! Macros for reducing code duplication in the python-ast library. [INFO] [stdout] | [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 2 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `crate` references the macro call's crate [INFO] [stdout] --> src/macros.rs:134:26 [INFO] [stdout] | [INFO] [stdout] 134 | let result = crate::parse($code, $file_name).unwrap(); [INFO] [stdout] | ^^^^^ help: to reference the macro definition's crate, use: `$crate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def [INFO] [stdout] = note: `#[warn(clippy::crate_in_macro_def)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/parser_utils.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / /// Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | use pyo3::{Bound, PyAny, PyResult, prelude::PyAnyMethods, types::PyTypeMethods}; [INFO] [stdout] | - the comment documents this `use` import [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 - /// Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] 1 + //! Generic utilities for parsing Python AST objects with consistent error handling. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/parser_utils.rs:196:1 [INFO] [stdout] | [INFO] [stdout] 196 | / /// Enhanced error handling utilities for parsing Python AST objects [INFO] [stdout] 197 | | [INFO] [stdout] | |_^ [INFO] [stdout] 198 | /// Get an attribute from a Python object with better error messaging [INFO] [stdout] 199 | pub fn get_attr_with_context<'a>( [INFO] [stdout] | ---------------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 197 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/attribute.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 27 | | ob.error_message( [INFO] [stdout] 28 | | "", [INFO] [stdout] 29 | | format!("extracting type name {:?} in attribute", dump(ob, None)), [INFO] [stdout] 30 | | ) [INFO] [stdout] 31 | | .as_str(), [INFO] [stdout] 32 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 26 ~ .unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 27 + "", [INFO] [stdout] 28 + format!("extracting type name {:?} in attribute", dump(ob, None)), [INFO] [stdout] 29 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/attribute.rs:41:6 [INFO] [stdout] | [INFO] [stdout] 41 | impl<'a> CodeGen for Attribute { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:22:14 [INFO] [stdout] | [INFO] [stdout] 22 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 23 | | ob.error_message("", "error getting assignment targets") [INFO] [stdout] 24 | | .as_str(), [INFO] [stdout] 25 | | ) [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting assignment targets")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:29:48 [INFO] [stdout] | [INFO] [stdout] 29 | let python_value = ob.getattr("value").expect( [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 30 | | ob.error_message("", "assignment statement value not found") [INFO] [stdout] 31 | | .as_str(), [INFO] [stdout] 32 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "assignment statement value not found")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:34:44 [INFO] [stdout] | [INFO] [stdout] 34 | let value = python_value.extract().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 35 | | ob.error_message("", "error getting value of assignment statement") [INFO] [stdout] 36 | | .as_str(), [INFO] [stdout] 37 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting value of assignment statement")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/assign.rs:47:6 [INFO] [stdout] | [INFO] [stdout] 47 | impl<'a> CodeGen for Assign { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `position` is used as a loop counter [INFO] [stdout] --> src/ast/tree/assign.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | for target in self.targets { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (position, target) in self.targets.into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/aug_assign.rs:100:21 [INFO] [stdout] | [INFO] [stdout] 100 | Err(format!("Matrix multiplication assignment not supported in Rust").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Matrix multiplication assignment not supported in Rust".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/aug_assign.rs:103:21 [INFO] [stdout] | [INFO] [stdout] 103 | Err(format!("Unknown augmented assignment operator").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unknown augmented assignment operator".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/await_kw.rs:24:6 [INFO] [stdout] | [INFO] [stdout] 24 | impl<'a> CodeGen for Await { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:19:44 [INFO] [stdout] | [INFO] [stdout] 19 | let op_type = ob.get_type().name().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 20 | | ob.error_message( [INFO] [stdout] 21 | | "", [INFO] [stdout] 22 | | format!("extracting type name {:?} for boolean operator", ob), [INFO] [stdout] 23 | | ) [INFO] [stdout] 24 | | .as_str(), [INFO] [stdout] 25 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 19 ~ let op_type = ob.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 20 + "", [INFO] [stdout] 21 + format!("extracting type name {:?} for boolean operator", ob), [INFO] [stdout] 22 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/bool_ops.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / return Ok(BoolOp { [INFO] [stdout] 95 | | op: op, [INFO] [stdout] 96 | | left: Box::new(left), [INFO] [stdout] 97 | | right: Box::new(right), [INFO] [stdout] 98 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 94 ~ Ok(BoolOp { [INFO] [stdout] 95 + op: op, [INFO] [stdout] 96 + left: Box::new(left), [INFO] [stdout] 97 + right: Box::new(right), [INFO] [stdout] 98 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:51:35 [INFO] [stdout] | [INFO] [stdout] 51 | let op = ob.getattr("op").expect( [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 52 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 53 | | .as_str(), [INFO] [stdout] 54 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:56:44 [INFO] [stdout] | [INFO] [stdout] 56 | let op_type = op.get_type().name().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 57 | | ob.error_message( [INFO] [stdout] 58 | | "", [INFO] [stdout] 59 | | format!("extracting type name {:?} for binary operator", op), [INFO] [stdout] 60 | | ) [INFO] [stdout] 61 | | .as_str(), [INFO] [stdout] 62 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 56 ~ let op_type = op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 57 + "", [INFO] [stdout] 58 + format!("extracting type name {:?} for binary operator", op), [INFO] [stdout] 59 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:64:43 [INFO] [stdout] | [INFO] [stdout] 64 | let values = ob.getattr("values").expect( [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 65 | | ob.error_message("", "error getting binary operand") [INFO] [stdout] 66 | | .as_str(), [INFO] [stdout] 67 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting binary operand")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/bool_ops.rs:102:6 [INFO] [stdout] | [INFO] [stdout] 102 | impl<'a> CodeGen for BoolOp { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/call.rs:29:6 [INFO] [stdout] | [INFO] [stdout] 29 | impl<'a> CodeGen for Call { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ast/tree/call.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if name_str.contains("async") || [INFO] [stdout] | ____________________^ [INFO] [stdout] 109 | | name_str.starts_with("a") || // Common async function naming [INFO] [stdout] 110 | | // TODO: Better async function detection based on symbol table [INFO] [stdout] 111 | | false { [INFO] [stdout] | |________________________^ help: try: `name_str.contains("async") || name_str.starts_with("a")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | //! a. If the properties of the class can be fully inferred, Data will be a simple struct and the attributes will be defined as fi... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 15 | //! a. If the properties of the class can be fully inferred, Data will be a simple struct and the attributes will be defined as fields of the struct. [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | //! b. If the properties of the class cannot be fully inferred, such as if the class is accessed as a dictionary, Data will be a H... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 16 | //! b. If the properties of the class cannot be fully inferred, such as if the class is accessed as a dictionary, Data will be a HashMap, [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | //! and the values will be accessed through it. [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 17 | //! and the values will be accessed through it. [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | //! it will be, otherwise (if the method refers to attributes of the class), a prototype will be added to Cls, and the implementatio... [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 22 | //! it will be, otherwise (if the method refers to attributes of the class), a prototype will be added to Cls, and the implementation will be done inside [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | //! an impl Cls for Data block. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 23 | //! an impl Cls for Data block. [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ast/tree/class_def.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if self.bases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.bases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/class_def.rs:95:22 [INFO] [stdout] | [INFO] [stdout] 95 | .expect(format!("Failed to parse statement {:?}", s).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to parse statement {:?}", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/class_def.rs:107:40 [INFO] [stdout] | [INFO] [stdout] 107 | let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/compare.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / return Ok(Compare { [INFO] [stdout] 116 | | ops: op_list, [INFO] [stdout] 117 | | left: Box::new(left), [INFO] [stdout] 118 | | comparators: comparators, [INFO] [stdout] 119 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 ~ Ok(Compare { [INFO] [stdout] 116 + ops: op_list, [INFO] [stdout] 117 + left: Box::new(left), [INFO] [stdout] 118 + comparators: comparators, [INFO] [stdout] 119 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 50 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 51 | | .as_str(), [INFO] [stdout] 52 | | ) [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let op_type = op.get_type().name().expect( [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 60 | | ob.error_message( [INFO] [stdout] 61 | | "", [INFO] [stdout] 62 | | "error extracting type name for binary operator", [INFO] [stdout] 63 | | ) [INFO] [stdout] 64 | | .as_str(), [INFO] [stdout] 65 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 59 ~ let op_type = op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 60 + "", [INFO] [stdout] 61 + "error extracting type name for binary operator", [INFO] [stdout] 62 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:88:39 [INFO] [stdout] | [INFO] [stdout] 88 | let left = ob.getattr("left").expect( [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 89 | | ob.error_message("", "error getting comparator") [INFO] [stdout] 90 | | .as_str(), [INFO] [stdout] 91 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting comparator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:93:53 [INFO] [stdout] | [INFO] [stdout] 93 | let comparators = ob.getattr("comparators").expect( [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 94 | | ob.error_message("", "error getting compoarator") [INFO] [stdout] 95 | | .as_str(), [INFO] [stdout] 96 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting compoarator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/ast/tree/constant.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl std::string::ToString for Constant { [INFO] [stdout] 43 | | fn to_string(&self) -> String { [INFO] [stdout] 44 | | match self.0.clone() { [INFO] [stdout] 45 | | Some(c) => c.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/constant.rs:111:41 [INFO] [stdout] | [INFO] [stdout] 111 | let value = ob.getattr("value").expect( [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 112 | | ob.error_message("", "error getting constant value") [INFO] [stdout] 113 | | .as_str(), [INFO] [stdout] 114 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting constant value")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/constant.rs:154:22 [INFO] [stdout] | [INFO] [stdout] 154 | .expect(format!("parsing Constant {}", c).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing Constant {}", c))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/ast/tree/expression.rs:31:1 [INFO] [stdout] | [INFO] [stdout] 31 | / pub enum ExprType { [INFO] [stdout] 32 | | BoolOp(BoolOp), [INFO] [stdout] 33 | | NamedExpr(NamedExpr), [INFO] [stdout] 34 | | BinOp(BinOp), [INFO] [stdout] 35 | | UnaryOp(UnaryOp), [INFO] [stdout] 36 | | Lambda(Lambda), [INFO] [stdout] | | -------------- the largest variant contains at least 432 bytes [INFO] [stdout] 37 | | IfExp(IfExp), [INFO] [stdout] 38 | | Dict(Dict), [INFO] [stdout] | | ---------- the second-largest variant contains at least 112 bytes [INFO] [stdout] ... | [INFO] [stdout] 65 | | Unknown, [INFO] [stdout] 66 | | } [INFO] [stdout] | |_^ the entire enum is at least 432 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 36 - Lambda(Lambda), [INFO] [stdout] 36 + Lambda(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/ast/tree/expression.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 81 | / let r = match expr_type.extract::()?.as_str() { [INFO] [stdout] 82 | | "Attribute" => { [INFO] [stdout] 83 | | let a = ob.extract().expect( [INFO] [stdout] 84 | | ob.error_message( [INFO] [stdout] ... | [INFO] [stdout] 351 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 352 | r [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 ~ match expr_type.extract::()?.as_str() { [INFO] [stdout] 83 + "Attribute" => { [INFO] [stdout] 84 + let a = ob.extract().expect( [INFO] [stdout] 85 + ob.error_message( [INFO] [stdout] 86 + "", [INFO] [stdout] 87 + format!("extracting Attribute in expression {}", dump(ob, None)?), [INFO] [stdout] 88 + ) [INFO] [stdout] 89 + .as_str(), [INFO] [stdout] 90 + ); [INFO] [stdout] 91 + Ok(Self::Attribute(a)) [INFO] [stdout] 92 + } [INFO] [stdout] 93 + "Await" => { [INFO] [stdout] 94 + //println!("await: {}", dump(ob, None)?); [INFO] [stdout] 95 + let a = ob.extract().expect( [INFO] [stdout] 96 + ob.error_message( [INFO] [stdout] 97 + "", [INFO] [stdout] 98 + format!("extracting await value in expression {}", dump(ob, None)?), [INFO] [stdout] 99 + ) [INFO] [stdout] 100 + .as_str(), [INFO] [stdout] 101 + ); [INFO] [stdout] 102 + Ok(Self::Await(a)) [INFO] [stdout] 103 + } [INFO] [stdout] 104 + "BoolOp" => { [INFO] [stdout] 105 + let b = ob.extract().expect( [INFO] [stdout] 106 + ob.error_message( [INFO] [stdout] 107 + "", [INFO] [stdout] 108 + format!("extracting BoolOp in expression {}", dump(ob, None)?), [INFO] [stdout] 109 + ) [INFO] [stdout] 110 + .as_str(), [INFO] [stdout] 111 + ); [INFO] [stdout] 112 + Ok(Self::BoolOp(b)) [INFO] [stdout] 113 + } [INFO] [stdout] 114 + "Call" => { [INFO] [stdout] 115 + let et = ob.extract().expect( [INFO] [stdout] 116 + ob.error_message( [INFO] [stdout] 117 + "", [INFO] [stdout] 118 + format!("parsing Call expression {}", dump(ob, None)?), [INFO] [stdout] 119 + ) [INFO] [stdout] 120 + .as_str(), [INFO] [stdout] 121 + ); [INFO] [stdout] 122 + Ok(Self::Call(et)) [INFO] [stdout] 123 + } [INFO] [stdout] 124 + "Compare" => { [INFO] [stdout] 125 + let c = ob.extract().expect( [INFO] [stdout] 126 + ob.error_message( [INFO] [stdout] 127 + "", [INFO] [stdout] 128 + format!("extracting Compare in expression {}", dump(ob, None)?), [INFO] [stdout] 129 + ) [INFO] [stdout] 130 + .as_str(), [INFO] [stdout] 131 + ); [INFO] [stdout] 132 + Ok(Self::Compare(c)) [INFO] [stdout] 133 + } [INFO] [stdout] 134 + "Constant" => { [INFO] [stdout] 135 + log::debug!("constant: {}", dump(ob, None)?); [INFO] [stdout] 136 + let c = ob.extract().expect( [INFO] [stdout] 137 + ob.error_message( [INFO] [stdout] 138 + "", [INFO] [stdout] 139 + format!("extracting Constant in expression {}", dump(ob, None)?), [INFO] [stdout] 140 + ) [INFO] [stdout] 141 + .as_str(), [INFO] [stdout] 142 + ); [INFO] [stdout] 143 + Ok(Self::Constant(c)) [INFO] [stdout] 144 + } [INFO] [stdout] 145 + "List" => { [INFO] [stdout] 146 + // Extract the list elements using the 'elts' attribute [INFO] [stdout] 147 + let elts_attr = ob.getattr("elts") [INFO] [stdout] 148 + .expect(format!("getting elts attribute from List {}", dump(ob, None)?).as_str()); [INFO] [stdout] 149 + let elts_vec: Vec> = elts_attr.extract() [INFO] [stdout] 150 + .expect(format!("extracting elts as Vec> from List {}", dump(ob, None)?).as_str()); [INFO] [stdout] 151 + [INFO] [stdout] 152 + // Convert each element to ExprType [INFO] [stdout] 153 + let mut expr_list = Vec::new(); [INFO] [stdout] 154 + for elt in elts_vec { [INFO] [stdout] 155 + let expr: ExprType = elt.extract() [INFO] [stdout] 156 + .expect(format!("extracting list element {}", dump(&elt, None)?).as_str()); [INFO] [stdout] 157 + expr_list.push(expr); [INFO] [stdout] 158 + } [INFO] [stdout] 159 + [INFO] [stdout] 160 + Ok(Self::List(expr_list)) [INFO] [stdout] 161 + } [INFO] [stdout] 162 + "ListComp" => { [INFO] [stdout] 163 + let lc = ob.extract().expect( [INFO] [stdout] 164 + ob.error_message( [INFO] [stdout] 165 + "", [INFO] [stdout] 166 + format!("extracting ListComp in expression {}", dump(ob, None)?), [INFO] [stdout] 167 + ) [INFO] [stdout] 168 + .as_str(), [INFO] [stdout] 169 + ); [INFO] [stdout] 170 + Ok(Self::ListComp(lc)) [INFO] [stdout] 171 + } [INFO] [stdout] 172 + "DictComp" => { [INFO] [stdout] 173 + let dc = ob.extract().expect( [INFO] [stdout] 174 + ob.error_message( [INFO] [stdout] 175 + "", [INFO] [stdout] 176 + format!("extracting DictComp in expression {}", dump(ob, None)?), [INFO] [stdout] 177 + ) [INFO] [stdout] 178 + .as_str(), [INFO] [stdout] 179 + ); [INFO] [stdout] 180 + Ok(Self::DictComp(dc)) [INFO] [stdout] 181 + } [INFO] [stdout] 182 + "SetComp" => { [INFO] [stdout] 183 + let sc = ob.extract().expect( [INFO] [stdout] 184 + ob.error_message( [INFO] [stdout] 185 + "", [INFO] [stdout] 186 + format!("extracting SetComp in expression {}", dump(ob, None)?), [INFO] [stdout] 187 + ) [INFO] [stdout] 188 + .as_str(), [INFO] [stdout] 189 + ); [INFO] [stdout] 190 + Ok(Self::SetComp(sc)) [INFO] [stdout] 191 + } [INFO] [stdout] 192 + "GeneratorExp" => { [INFO] [stdout] 193 + let ge = ob.extract().expect( [INFO] [stdout] 194 + ob.error_message( [INFO] [stdout] 195 + "", [INFO] [stdout] 196 + format!("extracting GeneratorExp in expression {}", dump(ob, None)?), [INFO] [stdout] 197 + ) [INFO] [stdout] 198 + .as_str(), [INFO] [stdout] 199 + ); [INFO] [stdout] 200 + Ok(Self::GeneratorExp(ge)) [INFO] [stdout] 201 + } [INFO] [stdout] 202 + "Name" => { [INFO] [stdout] 203 + let name = ob.extract().expect( [INFO] [stdout] 204 + ob.error_message( [INFO] [stdout] 205 + "", [INFO] [stdout] 206 + format!("parsing Name expression {}", dump(ob, None)?), [INFO] [stdout] 207 + ) [INFO] [stdout] 208 + .as_str(), [INFO] [stdout] 209 + ); [INFO] [stdout] 210 + Ok(Self::Name(name)) [INFO] [stdout] 211 + } [INFO] [stdout] 212 + "UnaryOp" => { [INFO] [stdout] 213 + let c = ob.extract().expect( [INFO] [stdout] 214 + ob.error_message( [INFO] [stdout] 215 + "", [INFO] [stdout] 216 + format!("extracting UnaryOp in expression {}", dump(ob, None)?), [INFO] [stdout] 217 + ) [INFO] [stdout] 218 + .as_str(), [INFO] [stdout] 219 + ); [INFO] [stdout] 220 + Ok(Self::UnaryOp(c)) [INFO] [stdout] 221 + } [INFO] [stdout] 222 + "BinOp" => { [INFO] [stdout] 223 + let c = ob.extract().expect( [INFO] [stdout] 224 + ob.error_message( [INFO] [stdout] 225 + "", [INFO] [stdout] 226 + format!("extracting BinOp in expression {}", dump(ob, None)?), [INFO] [stdout] 227 + ) [INFO] [stdout] 228 + .as_str(), [INFO] [stdout] 229 + ); [INFO] [stdout] 230 + Ok(Self::BinOp(c)) [INFO] [stdout] 231 + } [INFO] [stdout] 232 + "Lambda" => { [INFO] [stdout] 233 + let l = ob.extract().expect( [INFO] [stdout] 234 + ob.error_message( [INFO] [stdout] 235 + "", [INFO] [stdout] 236 + format!("extracting Lambda in expression {}", dump(ob, None)?), [INFO] [stdout] 237 + ) [INFO] [stdout] 238 + .as_str(), [INFO] [stdout] 239 + ); [INFO] [stdout] 240 + Ok(Self::Lambda(l)) [INFO] [stdout] 241 + } [INFO] [stdout] 242 + "IfExp" => { [INFO] [stdout] 243 + let i = ob.extract().expect( [INFO] [stdout] 244 + ob.error_message( [INFO] [stdout] 245 + "", [INFO] [stdout] 246 + format!("extracting IfExp in expression {}", dump(ob, None)?), [INFO] [stdout] 247 + ) [INFO] [stdout] 248 + .as_str(), [INFO] [stdout] 249 + ); [INFO] [stdout] 250 + Ok(Self::IfExp(i)) [INFO] [stdout] 251 + } [INFO] [stdout] 252 + "Dict" => { [INFO] [stdout] 253 + let d = ob.extract().expect( [INFO] [stdout] 254 + ob.error_message( [INFO] [stdout] 255 + "", [INFO] [stdout] 256 + format!("extracting Dict in expression {}", dump(ob, None)?), [INFO] [stdout] 257 + ) [INFO] [stdout] 258 + .as_str(), [INFO] [stdout] 259 + ); [INFO] [stdout] 260 + Ok(Self::Dict(d)) [INFO] [stdout] 261 + } [INFO] [stdout] 262 + "Set" => { [INFO] [stdout] 263 + let s = ob.extract().expect( [INFO] [stdout] 264 + ob.error_message( [INFO] [stdout] 265 + "", [INFO] [stdout] 266 + format!("extracting Set in expression {}", dump(ob, None)?), [INFO] [stdout] 267 + ) [INFO] [stdout] 268 + .as_str(), [INFO] [stdout] 269 + ); [INFO] [stdout] 270 + Ok(Self::Set(s)) [INFO] [stdout] 271 + } [INFO] [stdout] 272 + "Tuple" => { [INFO] [stdout] 273 + let t = ob.extract().expect( [INFO] [stdout] 274 + ob.error_message( [INFO] [stdout] 275 + "", [INFO] [stdout] 276 + format!("extracting Tuple in expression {}", dump(ob, None)?), [INFO] [stdout] 277 + ) [INFO] [stdout] 278 + .as_str(), [INFO] [stdout] 279 + ); [INFO] [stdout] 280 + Ok(Self::Tuple(t)) [INFO] [stdout] 281 + } [INFO] [stdout] 282 + "Subscript" => { [INFO] [stdout] 283 + let s = ob.extract().expect( [INFO] [stdout] 284 + ob.error_message( [INFO] [stdout] 285 + "", [INFO] [stdout] 286 + format!("extracting Subscript in expression {}", dump(ob, None)?), [INFO] [stdout] 287 + ) [INFO] [stdout] 288 + .as_str(), [INFO] [stdout] 289 + ); [INFO] [stdout] 290 + Ok(Self::Subscript(s)) [INFO] [stdout] 291 + } [INFO] [stdout] 292 + "Starred" => { [INFO] [stdout] 293 + let s = ob.extract().expect( [INFO] [stdout] 294 + ob.error_message( [INFO] [stdout] 295 + "", [INFO] [stdout] 296 + format!("extracting Starred in expression {}", dump(ob, None)?), [INFO] [stdout] 297 + ) [INFO] [stdout] 298 + .as_str(), [INFO] [stdout] 299 + ); [INFO] [stdout] 300 + Ok(Self::Starred(s)) [INFO] [stdout] 301 + } [INFO] [stdout] 302 + "Yield" => { [INFO] [stdout] 303 + let y = ob.extract().expect( [INFO] [stdout] 304 + ob.error_message( [INFO] [stdout] 305 + "", [INFO] [stdout] 306 + format!("extracting Yield in expression {}", dump(ob, None)?), [INFO] [stdout] 307 + ) [INFO] [stdout] 308 + .as_str(), [INFO] [stdout] 309 + ); [INFO] [stdout] 310 + Ok(Self::Yield(y)) [INFO] [stdout] 311 + } [INFO] [stdout] 312 + "YieldFrom" => { [INFO] [stdout] 313 + let yf = ob.extract().expect( [INFO] [stdout] 314 + ob.error_message( [INFO] [stdout] 315 + "", [INFO] [stdout] 316 + format!("extracting YieldFrom in expression {}", dump(ob, None)?), [INFO] [stdout] 317 + ) [INFO] [stdout] 318 + .as_str(), [INFO] [stdout] 319 + ); [INFO] [stdout] 320 + Ok(Self::YieldFrom(yf)) [INFO] [stdout] 321 + } [INFO] [stdout] 322 + "JoinedStr" => { [INFO] [stdout] 323 + let js = ob.extract().expect( [INFO] [stdout] 324 + ob.error_message( [INFO] [stdout] 325 + "", [INFO] [stdout] 326 + format!("extracting JoinedStr in expression {}", dump(ob, None)?), [INFO] [stdout] 327 + ) [INFO] [stdout] 328 + .as_str(), [INFO] [stdout] 329 + ); [INFO] [stdout] 330 + Ok(Self::JoinedStr(js)) [INFO] [stdout] 331 + } [INFO] [stdout] 332 + "FormattedValue" => { [INFO] [stdout] 333 + let fv = ob.extract().expect( [INFO] [stdout] 334 + ob.error_message( [INFO] [stdout] 335 + "", [INFO] [stdout] 336 + format!("extracting FormattedValue in expression {}", dump(ob, None)?), [INFO] [stdout] 337 + ) [INFO] [stdout] 338 + .as_str(), [INFO] [stdout] 339 + ); [INFO] [stdout] 340 + Ok(Self::FormattedValue(fv)) [INFO] [stdout] 341 + } [INFO] [stdout] 342 + _ => { [INFO] [stdout] 343 + let err_msg = format!( [INFO] [stdout] 344 + "Unimplemented expression type {}, {}", [INFO] [stdout] 345 + expr_type, [INFO] [stdout] 346 + dump(ob, None)? [INFO] [stdout] 347 + ); [INFO] [stdout] 348 + Err(pyo3::exceptions::PyValueError::new_err( [INFO] [stdout] 349 + ob.error_message("", err_msg.as_str()), [INFO] [stdout] 350 + )) [INFO] [stdout] 351 + } [INFO] [stdout] 352 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:72:46 [INFO] [stdout] | [INFO] [stdout] 72 | let expr_type = ob.get_type().name().expect( [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 73 | | ob.error_message( [INFO] [stdout] 74 | | "", [INFO] [stdout] 75 | | format!("extracting type name {:?} in expression", dump(ob, None)), [INFO] [stdout] 76 | | ) [INFO] [stdout] 77 | | .as_str(), [INFO] [stdout] 78 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 72 ~ let expr_type = ob.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 73 + "", [INFO] [stdout] 74 + format!("extracting type name {:?} in expression", dump(ob, None)), [INFO] [stdout] 75 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/expression.rs:356:6 [INFO] [stdout] | [INFO] [stdout] 356 | impl<'a> CodeGen for ExprType { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:398:26 [INFO] [stdout] | [INFO] [stdout] 398 | .expect(format!("Extracting list item {:?}", li).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Extracting list item {:?}", li))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:495:14 [INFO] [stdout] | [INFO] [stdout] 495 | .expect(ob.error_message("", err_msg.as_str()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", err_msg.as_str())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:514:52 [INFO] [stdout] | [INFO] [stdout] 514 | let expr_type = ob_value.get_type().name().expect( [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 515 | | ob.error_message( [INFO] [stdout] 516 | | "", [INFO] [stdout] 517 | | format!("extracting type name {:?} in expression", ob_value), [INFO] [stdout] 518 | | ) [INFO] [stdout] 519 | | .as_str(), [INFO] [stdout] 520 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 514 ~ let expr_type = ob_value.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 515 + "", [INFO] [stdout] 516 + format!("extracting type name {:?} in expression", ob_value), [INFO] [stdout] 517 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:572:45 [INFO] [stdout] | [INFO] [stdout] 572 | let et = ob_value.extract().expect( [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 573 | | ob.error_message( [INFO] [stdout] 574 | | "", [INFO] [stdout] 575 | | format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 576 | | ) [INFO] [stdout] 577 | | .as_str(), [INFO] [stdout] 578 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 572 ~ let et = ob_value.extract().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 573 + "", [INFO] [stdout] 574 + format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 575 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:621:26 [INFO] [stdout] | [INFO] [stdout] 621 | .expect(&format!("extracting list element {}", dump(&elt, None).unwrap_or_else(|_| "unknown".to_string()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("extracting list element {}", dump(&elt, None).unwrap_or_else(|_| "unknown".to_string())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:629:47 [INFO] [stdout] | [INFO] [stdout] 629 | let name = ob_value.extract().expect( [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 630 | | ob.error_message( [INFO] [stdout] 631 | | "", [INFO] [stdout] 632 | | format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 633 | | ) [INFO] [stdout] 634 | | .as_str(), [INFO] [stdout] 635 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 629 ~ let name = ob_value.extract().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 630 + "", [INFO] [stdout] 631 + format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 632 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/function_def.rs:86:14 [INFO] [stdout] | [INFO] [stdout] 86 | .expect(format!("parsing arguments {:?}", self.args).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing arguments {:?}", self.args))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/function_def.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | .expect(format!("parsing statement {:?}", s).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing statement {:?}", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/function_def.rs:105:40 [INFO] [stdout] | [INFO] [stdout] 105 | let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/function_def.rs:183:36 [INFO] [stdout] | [INFO] [stdout] 183 | formatted.push(format!("```rust")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"```rust".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/ast/tree/name.rs:35:1 [INFO] [stdout] | [INFO] [stdout] 35 | impl Into for Identifier { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 35 ~ impl From for String { [INFO] [stdout] 36 ~ fn from(val: Identifier) -> Self { [INFO] [stdout] 37 ~ val.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/ast/tree/name.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | impl Into for Name { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 70 ~ impl From for String { [INFO] [stdout] 71 ~ fn from(val: Name) -> Self { [INFO] [stdout] 72 ~ val.id [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/named_expression.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | .expect(format!("parsing left side of named expression {:?}", self.left).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing left side of named expression {:?}", self.left))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/named_expression.rs:43:63 [INFO] [stdout] | [INFO] [stdout] 43 | self.right.clone().to_rust(ctx, options, symbols).expect( [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 44 | | format!("parsing right side of named expression {:?}", self.right).as_str(), [INFO] [stdout] 45 | | ); [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("parsing right side of named expression {:?}", self.right))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/unary_op.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / return Ok(UnaryOp { [INFO] [stdout] 76 | | op: op, [INFO] [stdout] 77 | | operand: Box::new(operand), [INFO] [stdout] 78 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 75 ~ Ok(UnaryOp { [INFO] [stdout] 76 + op: op, [INFO] [stdout] 77 + operand: Box::new(operand), [INFO] [stdout] 78 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:41:52 [INFO] [stdout] | [INFO] [stdout] 41 | let op = ob.as_unbound().getattr(py, "op").expect( [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 42 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 43 | | .as_str(), [INFO] [stdout] 44 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:47:50 [INFO] [stdout] | [INFO] [stdout] 47 | let op_type = bound_op.get_type().name().expect( [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 48 | | ob.error_message( [INFO] [stdout] 49 | | "", [INFO] [stdout] 50 | | format!("extracting type name {:?} for unary operator", op), [INFO] [stdout] 51 | | ) [INFO] [stdout] 52 | | .as_str(), [INFO] [stdout] 53 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ let op_type = bound_op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 48 + "", [INFO] [stdout] 49 + format!("extracting type name {:?} for unary operator", op), [INFO] [stdout] 50 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:55:62 [INFO] [stdout] | [INFO] [stdout] 55 | let operand = ob.as_unbound().getattr(py, "operand").expect( [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 56 | | ob.error_message("", "error getting unary operand") [INFO] [stdout] 57 | | .as_str(), [INFO] [stdout] 58 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operand")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ast/tree/unary_op.rs:71:41 [INFO] [stdout] | [INFO] [stdout] 71 | log::debug!("operand: {}", dump(&operand.bind(py), None)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `operand.bind(py)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/module.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | ... let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/module.rs:165:18 [INFO] [stdout] | [INFO] [stdout] 165 | .expect(format!("parsing statement {:?} in module", s).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing statement {:?} in module", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:207:30 [INFO] [stdout] | [INFO] [stdout] 207 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 208 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 208 - .unwrap_or_else(|_| stream); [INFO] [stdout] 208 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:215:34 [INFO] [stdout] | [INFO] [stdout] 215 | stream = renamed_stream_str.parse::() [INFO] [stdout] | __________________________________^ [INFO] [stdout] 216 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 216 - .unwrap_or_else(|_| stream); [INFO] [stdout] 216 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:230:30 [INFO] [stdout] | [INFO] [stdout] 230 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 231 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 231 - .unwrap_or_else(|_| stream); [INFO] [stdout] 231 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:237:34 [INFO] [stdout] | [INFO] [stdout] 237 | stream = renamed_stream_str.parse::() [INFO] [stdout] | __________________________________^ [INFO] [stdout] 238 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 238 - .unwrap_or_else(|_| stream); [INFO] [stdout] 238 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:256:30 [INFO] [stdout] | [INFO] [stdout] 256 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 257 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 257 - .unwrap_or_else(|_| stream); [INFO] [stdout] 257 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ast/tree/module.rs:263:25 [INFO] [stdout] | [INFO] [stdout] 263 | / if updated_stmt_str != stmt_str { [INFO] [stdout] 264 | | if let Ok(new_stmt) = updated_stmt_str.parse::() { [INFO] [stdout] 265 | | *stmt = new_stmt; [INFO] [stdout] 266 | | } [INFO] [stdout] 267 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 263 ~ if updated_stmt_str != stmt_str [INFO] [stdout] 264 ~ && let Ok(new_stmt) = updated_stmt_str.parse::() { [INFO] [stdout] 265 | *stmt = new_stmt; [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ast/tree/module.rs:350:38 [INFO] [stdout] | [INFO] [stdout] 350 | call.args.iter().any(|arg| Self::is_main_function_call(arg)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Self::is_main_function_call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ast/tree/module.rs:531:9 [INFO] [stdout] | [INFO] [stdout] 531 | / if let StatementType::Expr(expr) = &first_stmt.statement { [INFO] [stdout] 532 | | if let ExprType::Constant(c) = &expr.value { [INFO] [stdout] 533 | | let raw_string = c.to_string(); [INFO] [stdout] 534 | | let content = raw_string.trim_matches('"'); [INFO] [stdout] ... | [INFO] [stdout] 545 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 531 ~ if let StatementType::Expr(expr) = &first_stmt.statement [INFO] [stdout] 532 ~ && let ExprType::Constant(c) = &expr.value { [INFO] [stdout] 533 | let raw_string = c.to_string(); [INFO] [stdout] ... [INFO] [stdout] 543 | || content.len() > 50; // Longer strings are more likely to be docstrings [INFO] [stdout] 544 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/statement.rs:73:14 [INFO] [stdout] | [INFO] [stdout] 73 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 74 | | self.error_message( [INFO] [stdout] 75 | | "", [INFO] [stdout] 76 | | format!("failed to compile statement {:#?}", self), [INFO] [stdout] 77 | | ) [INFO] [stdout] 78 | | .as_str(), [INFO] [stdout] 79 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 ~ .unwrap_or_else(|_| panic!("{}", self.error_message( [INFO] [stdout] 74 + "", [INFO] [stdout] 75 + format!("failed to compile statement {:#?}", self), [INFO] [stdout] 76 ~ )))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/statement.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | .expect(format!("Expr {:?}", ob).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Expr {:?}", ob))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/attribute.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 27 | | ob.error_message( [INFO] [stdout] 28 | | "", [INFO] [stdout] 29 | | format!("extracting type name {:?} in attribute", dump(ob, None)), [INFO] [stdout] 30 | | ) [INFO] [stdout] 31 | | .as_str(), [INFO] [stdout] 32 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 26 ~ .unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 27 + "", [INFO] [stdout] 28 + format!("extracting type name {:?} in attribute", dump(ob, None)), [INFO] [stdout] 29 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/attribute.rs:41:6 [INFO] [stdout] | [INFO] [stdout] 41 | impl<'a> CodeGen for Attribute { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:22:14 [INFO] [stdout] | [INFO] [stdout] 22 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 23 | | ob.error_message("", "error getting assignment targets") [INFO] [stdout] 24 | | .as_str(), [INFO] [stdout] 25 | | ) [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting assignment targets")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:29:48 [INFO] [stdout] | [INFO] [stdout] 29 | let python_value = ob.getattr("value").expect( [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 30 | | ob.error_message("", "assignment statement value not found") [INFO] [stdout] 31 | | .as_str(), [INFO] [stdout] 32 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "assignment statement value not found")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/assign.rs:34:44 [INFO] [stdout] | [INFO] [stdout] 34 | let value = python_value.extract().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 35 | | ob.error_message("", "error getting value of assignment statement") [INFO] [stdout] 36 | | .as_str(), [INFO] [stdout] 37 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting value of assignment statement")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/assign.rs:47:6 [INFO] [stdout] | [INFO] [stdout] 47 | impl<'a> CodeGen for Assign { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `position` is used as a loop counter [INFO] [stdout] --> src/ast/tree/assign.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | for target in self.targets { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (position, target) in self.targets.into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/aug_assign.rs:100:21 [INFO] [stdout] | [INFO] [stdout] 100 | Err(format!("Matrix multiplication assignment not supported in Rust").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Matrix multiplication assignment not supported in Rust".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/aug_assign.rs:103:21 [INFO] [stdout] | [INFO] [stdout] 103 | Err(format!("Unknown augmented assignment operator").into()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unknown augmented assignment operator".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/await_kw.rs:24:6 [INFO] [stdout] | [INFO] [stdout] 24 | impl<'a> CodeGen for Await { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:19:44 [INFO] [stdout] | [INFO] [stdout] 19 | let op_type = ob.get_type().name().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 20 | | ob.error_message( [INFO] [stdout] 21 | | "", [INFO] [stdout] 22 | | format!("extracting type name {:?} for boolean operator", ob), [INFO] [stdout] 23 | | ) [INFO] [stdout] 24 | | .as_str(), [INFO] [stdout] 25 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 19 ~ let op_type = ob.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 20 + "", [INFO] [stdout] 21 + format!("extracting type name {:?} for boolean operator", ob), [INFO] [stdout] 22 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/bool_ops.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / return Ok(BoolOp { [INFO] [stdout] 95 | | op: op, [INFO] [stdout] 96 | | left: Box::new(left), [INFO] [stdout] 97 | | right: Box::new(right), [INFO] [stdout] 98 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 94 ~ Ok(BoolOp { [INFO] [stdout] 95 + op: op, [INFO] [stdout] 96 + left: Box::new(left), [INFO] [stdout] 97 + right: Box::new(right), [INFO] [stdout] 98 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:51:35 [INFO] [stdout] | [INFO] [stdout] 51 | let op = ob.getattr("op").expect( [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 52 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 53 | | .as_str(), [INFO] [stdout] 54 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:56:44 [INFO] [stdout] | [INFO] [stdout] 56 | let op_type = op.get_type().name().expect( [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 57 | | ob.error_message( [INFO] [stdout] 58 | | "", [INFO] [stdout] 59 | | format!("extracting type name {:?} for binary operator", op), [INFO] [stdout] 60 | | ) [INFO] [stdout] 61 | | .as_str(), [INFO] [stdout] 62 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 56 ~ let op_type = op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 57 + "", [INFO] [stdout] 58 + format!("extracting type name {:?} for binary operator", op), [INFO] [stdout] 59 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/bool_ops.rs:64:43 [INFO] [stdout] | [INFO] [stdout] 64 | let values = ob.getattr("values").expect( [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 65 | | ob.error_message("", "error getting binary operand") [INFO] [stdout] 66 | | .as_str(), [INFO] [stdout] 67 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting binary operand")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/bool_ops.rs:102:6 [INFO] [stdout] | [INFO] [stdout] 102 | impl<'a> CodeGen for BoolOp { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/call.rs:29:6 [INFO] [stdout] | [INFO] [stdout] 29 | impl<'a> CodeGen for Call { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ast/tree/call.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if name_str.contains("async") || [INFO] [stdout] | ____________________^ [INFO] [stdout] 109 | | name_str.starts_with("a") || // Common async function naming [INFO] [stdout] 110 | | // TODO: Better async function detection based on symbol table [INFO] [stdout] 111 | | false { [INFO] [stdout] | |________________________^ help: try: `name_str.contains("async") || name_str.starts_with("a")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | //! a. If the properties of the class can be fully inferred, Data will be a simple struct and the attributes will be defined as fi... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 15 | //! a. If the properties of the class can be fully inferred, Data will be a simple struct and the attributes will be defined as fields of the struct. [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | //! b. If the properties of the class cannot be fully inferred, such as if the class is accessed as a dictionary, Data will be a H... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 16 | //! b. If the properties of the class cannot be fully inferred, such as if the class is accessed as a dictionary, Data will be a HashMap, [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | //! and the values will be accessed through it. [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 17 | //! and the values will be accessed through it. [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | //! it will be, otherwise (if the method refers to attributes of the class), a prototype will be added to Cls, and the implementatio... [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 22 | //! it will be, otherwise (if the method refers to attributes of the class), a prototype will be added to Cls, and the implementation will be done inside [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/ast/tree/class_def.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | //! an impl Cls for Data block. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 23 | //! an impl Cls for Data block. [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ast/tree/class_def.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if self.bases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.bases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/class_def.rs:95:22 [INFO] [stdout] | [INFO] [stdout] 95 | .expect(format!("Failed to parse statement {:?}", s).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to parse statement {:?}", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/class_def.rs:107:40 [INFO] [stdout] | [INFO] [stdout] 107 | let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/compare.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / return Ok(Compare { [INFO] [stdout] 116 | | ops: op_list, [INFO] [stdout] 117 | | left: Box::new(left), [INFO] [stdout] 118 | | comparators: comparators, [INFO] [stdout] 119 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 ~ Ok(Compare { [INFO] [stdout] 116 + ops: op_list, [INFO] [stdout] 117 + left: Box::new(left), [INFO] [stdout] 118 + comparators: comparators, [INFO] [stdout] 119 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 50 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 51 | | .as_str(), [INFO] [stdout] 52 | | ) [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let op_type = op.get_type().name().expect( [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 60 | | ob.error_message( [INFO] [stdout] 61 | | "", [INFO] [stdout] 62 | | "error extracting type name for binary operator", [INFO] [stdout] 63 | | ) [INFO] [stdout] 64 | | .as_str(), [INFO] [stdout] 65 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 59 ~ let op_type = op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 60 + "", [INFO] [stdout] 61 + "error extracting type name for binary operator", [INFO] [stdout] 62 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:88:39 [INFO] [stdout] | [INFO] [stdout] 88 | let left = ob.getattr("left").expect( [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 89 | | ob.error_message("", "error getting comparator") [INFO] [stdout] 90 | | .as_str(), [INFO] [stdout] 91 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting comparator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/compare.rs:93:53 [INFO] [stdout] | [INFO] [stdout] 93 | let comparators = ob.getattr("comparators").expect( [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 94 | | ob.error_message("", "error getting compoarator") [INFO] [stdout] 95 | | .as_str(), [INFO] [stdout] 96 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting compoarator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/ast/tree/constant.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl std::string::ToString for Constant { [INFO] [stdout] 43 | | fn to_string(&self) -> String { [INFO] [stdout] 44 | | match self.0.clone() { [INFO] [stdout] 45 | | Some(c) => c.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/constant.rs:111:41 [INFO] [stdout] | [INFO] [stdout] 111 | let value = ob.getattr("value").expect( [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 112 | | ob.error_message("", "error getting constant value") [INFO] [stdout] 113 | | .as_str(), [INFO] [stdout] 114 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting constant value")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/constant.rs:154:22 [INFO] [stdout] | [INFO] [stdout] 154 | .expect(format!("parsing Constant {}", c).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing Constant {}", c))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `debug!` args [INFO] [stdout] --> src/ast/tree/constant.rs:179:30 [INFO] [stdout] | [INFO] [stdout] 179 | debug!("ast: {}", ast.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/ast/tree/expression.rs:31:1 [INFO] [stdout] | [INFO] [stdout] 31 | / pub enum ExprType { [INFO] [stdout] 32 | | BoolOp(BoolOp), [INFO] [stdout] 33 | | NamedExpr(NamedExpr), [INFO] [stdout] 34 | | BinOp(BinOp), [INFO] [stdout] 35 | | UnaryOp(UnaryOp), [INFO] [stdout] 36 | | Lambda(Lambda), [INFO] [stdout] | | -------------- the largest variant contains at least 432 bytes [INFO] [stdout] 37 | | IfExp(IfExp), [INFO] [stdout] 38 | | Dict(Dict), [INFO] [stdout] | | ---------- the second-largest variant contains at least 112 bytes [INFO] [stdout] ... | [INFO] [stdout] 65 | | Unknown, [INFO] [stdout] 66 | | } [INFO] [stdout] | |_^ the entire enum is at least 432 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 36 - Lambda(Lambda), [INFO] [stdout] 36 + Lambda(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/ast/tree/expression.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 81 | / let r = match expr_type.extract::()?.as_str() { [INFO] [stdout] 82 | | "Attribute" => { [INFO] [stdout] 83 | | let a = ob.extract().expect( [INFO] [stdout] 84 | | ob.error_message( [INFO] [stdout] ... | [INFO] [stdout] 351 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 352 | r [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 ~ match expr_type.extract::()?.as_str() { [INFO] [stdout] 83 + "Attribute" => { [INFO] [stdout] 84 + let a = ob.extract().expect( [INFO] [stdout] 85 + ob.error_message( [INFO] [stdout] 86 + "", [INFO] [stdout] 87 + format!("extracting Attribute in expression {}", dump(ob, None)?), [INFO] [stdout] 88 + ) [INFO] [stdout] 89 + .as_str(), [INFO] [stdout] 90 + ); [INFO] [stdout] 91 + Ok(Self::Attribute(a)) [INFO] [stdout] 92 + } [INFO] [stdout] 93 + "Await" => { [INFO] [stdout] 94 + //println!("await: {}", dump(ob, None)?); [INFO] [stdout] 95 + let a = ob.extract().expect( [INFO] [stdout] 96 + ob.error_message( [INFO] [stdout] 97 + "", [INFO] [stdout] 98 + format!("extracting await value in expression {}", dump(ob, None)?), [INFO] [stdout] 99 + ) [INFO] [stdout] 100 + .as_str(), [INFO] [stdout] 101 + ); [INFO] [stdout] 102 + Ok(Self::Await(a)) [INFO] [stdout] 103 + } [INFO] [stdout] 104 + "BoolOp" => { [INFO] [stdout] 105 + let b = ob.extract().expect( [INFO] [stdout] 106 + ob.error_message( [INFO] [stdout] 107 + "", [INFO] [stdout] 108 + format!("extracting BoolOp in expression {}", dump(ob, None)?), [INFO] [stdout] 109 + ) [INFO] [stdout] 110 + .as_str(), [INFO] [stdout] 111 + ); [INFO] [stdout] 112 + Ok(Self::BoolOp(b)) [INFO] [stdout] 113 + } [INFO] [stdout] 114 + "Call" => { [INFO] [stdout] 115 + let et = ob.extract().expect( [INFO] [stdout] 116 + ob.error_message( [INFO] [stdout] 117 + "", [INFO] [stdout] 118 + format!("parsing Call expression {}", dump(ob, None)?), [INFO] [stdout] 119 + ) [INFO] [stdout] 120 + .as_str(), [INFO] [stdout] 121 + ); [INFO] [stdout] 122 + Ok(Self::Call(et)) [INFO] [stdout] 123 + } [INFO] [stdout] 124 + "Compare" => { [INFO] [stdout] 125 + let c = ob.extract().expect( [INFO] [stdout] 126 + ob.error_message( [INFO] [stdout] 127 + "", [INFO] [stdout] 128 + format!("extracting Compare in expression {}", dump(ob, None)?), [INFO] [stdout] 129 + ) [INFO] [stdout] 130 + .as_str(), [INFO] [stdout] 131 + ); [INFO] [stdout] 132 + Ok(Self::Compare(c)) [INFO] [stdout] 133 + } [INFO] [stdout] 134 + "Constant" => { [INFO] [stdout] 135 + log::debug!("constant: {}", dump(ob, None)?); [INFO] [stdout] 136 + let c = ob.extract().expect( [INFO] [stdout] 137 + ob.error_message( [INFO] [stdout] 138 + "", [INFO] [stdout] 139 + format!("extracting Constant in expression {}", dump(ob, None)?), [INFO] [stdout] 140 + ) [INFO] [stdout] 141 + .as_str(), [INFO] [stdout] 142 + ); [INFO] [stdout] 143 + Ok(Self::Constant(c)) [INFO] [stdout] 144 + } [INFO] [stdout] 145 + "List" => { [INFO] [stdout] 146 + // Extract the list elements using the 'elts' attribute [INFO] [stdout] 147 + let elts_attr = ob.getattr("elts") [INFO] [stdout] 148 + .expect(format!("getting elts attribute from List {}", dump(ob, None)?).as_str()); [INFO] [stdout] 149 + let elts_vec: Vec> = elts_attr.extract() [INFO] [stdout] 150 + .expect(format!("extracting elts as Vec> from List {}", dump(ob, None)?).as_str()); [INFO] [stdout] 151 + [INFO] [stdout] 152 + // Convert each element to ExprType [INFO] [stdout] 153 + let mut expr_list = Vec::new(); [INFO] [stdout] 154 + for elt in elts_vec { [INFO] [stdout] 155 + let expr: ExprType = elt.extract() [INFO] [stdout] 156 + .expect(format!("extracting list element {}", dump(&elt, None)?).as_str()); [INFO] [stdout] 157 + expr_list.push(expr); [INFO] [stdout] 158 + } [INFO] [stdout] 159 + [INFO] [stdout] 160 + Ok(Self::List(expr_list)) [INFO] [stdout] 161 + } [INFO] [stdout] 162 + "ListComp" => { [INFO] [stdout] 163 + let lc = ob.extract().expect( [INFO] [stdout] 164 + ob.error_message( [INFO] [stdout] 165 + "", [INFO] [stdout] 166 + format!("extracting ListComp in expression {}", dump(ob, None)?), [INFO] [stdout] 167 + ) [INFO] [stdout] 168 + .as_str(), [INFO] [stdout] 169 + ); [INFO] [stdout] 170 + Ok(Self::ListComp(lc)) [INFO] [stdout] 171 + } [INFO] [stdout] 172 + "DictComp" => { [INFO] [stdout] 173 + let dc = ob.extract().expect( [INFO] [stdout] 174 + ob.error_message( [INFO] [stdout] 175 + "", [INFO] [stdout] 176 + format!("extracting DictComp in expression {}", dump(ob, None)?), [INFO] [stdout] 177 + ) [INFO] [stdout] 178 + .as_str(), [INFO] [stdout] 179 + ); [INFO] [stdout] 180 + Ok(Self::DictComp(dc)) [INFO] [stdout] 181 + } [INFO] [stdout] 182 + "SetComp" => { [INFO] [stdout] 183 + let sc = ob.extract().expect( [INFO] [stdout] 184 + ob.error_message( [INFO] [stdout] 185 + "", [INFO] [stdout] 186 + format!("extracting SetComp in expression {}", dump(ob, None)?), [INFO] [stdout] 187 + ) [INFO] [stdout] 188 + .as_str(), [INFO] [stdout] 189 + ); [INFO] [stdout] 190 + Ok(Self::SetComp(sc)) [INFO] [stdout] 191 + } [INFO] [stdout] 192 + "GeneratorExp" => { [INFO] [stdout] 193 + let ge = ob.extract().expect( [INFO] [stdout] 194 + ob.error_message( [INFO] [stdout] 195 + "", [INFO] [stdout] 196 + format!("extracting GeneratorExp in expression {}", dump(ob, None)?), [INFO] [stdout] 197 + ) [INFO] [stdout] 198 + .as_str(), [INFO] [stdout] 199 + ); [INFO] [stdout] 200 + Ok(Self::GeneratorExp(ge)) [INFO] [stdout] 201 + } [INFO] [stdout] 202 + "Name" => { [INFO] [stdout] 203 + let name = ob.extract().expect( [INFO] [stdout] 204 + ob.error_message( [INFO] [stdout] 205 + "", [INFO] [stdout] 206 + format!("parsing Name expression {}", dump(ob, None)?), [INFO] [stdout] 207 + ) [INFO] [stdout] 208 + .as_str(), [INFO] [stdout] 209 + ); [INFO] [stdout] 210 + Ok(Self::Name(name)) [INFO] [stdout] 211 + } [INFO] [stdout] 212 + "UnaryOp" => { [INFO] [stdout] 213 + let c = ob.extract().expect( [INFO] [stdout] 214 + ob.error_message( [INFO] [stdout] 215 + "", [INFO] [stdout] 216 + format!("extracting UnaryOp in expression {}", dump(ob, None)?), [INFO] [stdout] 217 + ) [INFO] [stdout] 218 + .as_str(), [INFO] [stdout] 219 + ); [INFO] [stdout] 220 + Ok(Self::UnaryOp(c)) [INFO] [stdout] 221 + } [INFO] [stdout] 222 + "BinOp" => { [INFO] [stdout] 223 + let c = ob.extract().expect( [INFO] [stdout] 224 + ob.error_message( [INFO] [stdout] 225 + "", [INFO] [stdout] 226 + format!("extracting BinOp in expression {}", dump(ob, None)?), [INFO] [stdout] 227 + ) [INFO] [stdout] 228 + .as_str(), [INFO] [stdout] 229 + ); [INFO] [stdout] 230 + Ok(Self::BinOp(c)) [INFO] [stdout] 231 + } [INFO] [stdout] 232 + "Lambda" => { [INFO] [stdout] 233 + let l = ob.extract().expect( [INFO] [stdout] 234 + ob.error_message( [INFO] [stdout] 235 + "", [INFO] [stdout] 236 + format!("extracting Lambda in expression {}", dump(ob, None)?), [INFO] [stdout] 237 + ) [INFO] [stdout] 238 + .as_str(), [INFO] [stdout] 239 + ); [INFO] [stdout] 240 + Ok(Self::Lambda(l)) [INFO] [stdout] 241 + } [INFO] [stdout] 242 + "IfExp" => { [INFO] [stdout] 243 + let i = ob.extract().expect( [INFO] [stdout] 244 + ob.error_message( [INFO] [stdout] 245 + "", [INFO] [stdout] 246 + format!("extracting IfExp in expression {}", dump(ob, None)?), [INFO] [stdout] 247 + ) [INFO] [stdout] 248 + .as_str(), [INFO] [stdout] 249 + ); [INFO] [stdout] 250 + Ok(Self::IfExp(i)) [INFO] [stdout] 251 + } [INFO] [stdout] 252 + "Dict" => { [INFO] [stdout] 253 + let d = ob.extract().expect( [INFO] [stdout] 254 + ob.error_message( [INFO] [stdout] 255 + "", [INFO] [stdout] 256 + format!("extracting Dict in expression {}", dump(ob, None)?), [INFO] [stdout] 257 + ) [INFO] [stdout] 258 + .as_str(), [INFO] [stdout] 259 + ); [INFO] [stdout] 260 + Ok(Self::Dict(d)) [INFO] [stdout] 261 + } [INFO] [stdout] 262 + "Set" => { [INFO] [stdout] 263 + let s = ob.extract().expect( [INFO] [stdout] 264 + ob.error_message( [INFO] [stdout] 265 + "", [INFO] [stdout] 266 + format!("extracting Set in expression {}", dump(ob, None)?), [INFO] [stdout] 267 + ) [INFO] [stdout] 268 + .as_str(), [INFO] [stdout] 269 + ); [INFO] [stdout] 270 + Ok(Self::Set(s)) [INFO] [stdout] 271 + } [INFO] [stdout] 272 + "Tuple" => { [INFO] [stdout] 273 + let t = ob.extract().expect( [INFO] [stdout] 274 + ob.error_message( [INFO] [stdout] 275 + "", [INFO] [stdout] 276 + format!("extracting Tuple in expression {}", dump(ob, None)?), [INFO] [stdout] 277 + ) [INFO] [stdout] 278 + .as_str(), [INFO] [stdout] 279 + ); [INFO] [stdout] 280 + Ok(Self::Tuple(t)) [INFO] [stdout] 281 + } [INFO] [stdout] 282 + "Subscript" => { [INFO] [stdout] 283 + let s = ob.extract().expect( [INFO] [stdout] 284 + ob.error_message( [INFO] [stdout] 285 + "", [INFO] [stdout] 286 + format!("extracting Subscript in expression {}", dump(ob, None)?), [INFO] [stdout] 287 + ) [INFO] [stdout] 288 + .as_str(), [INFO] [stdout] 289 + ); [INFO] [stdout] 290 + Ok(Self::Subscript(s)) [INFO] [stdout] 291 + } [INFO] [stdout] 292 + "Starred" => { [INFO] [stdout] 293 + let s = ob.extract().expect( [INFO] [stdout] 294 + ob.error_message( [INFO] [stdout] 295 + "", [INFO] [stdout] 296 + format!("extracting Starred in expression {}", dump(ob, None)?), [INFO] [stdout] 297 + ) [INFO] [stdout] 298 + .as_str(), [INFO] [stdout] 299 + ); [INFO] [stdout] 300 + Ok(Self::Starred(s)) [INFO] [stdout] 301 + } [INFO] [stdout] 302 + "Yield" => { [INFO] [stdout] 303 + let y = ob.extract().expect( [INFO] [stdout] 304 + ob.error_message( [INFO] [stdout] 305 + "", [INFO] [stdout] 306 + format!("extracting Yield in expression {}", dump(ob, None)?), [INFO] [stdout] 307 + ) [INFO] [stdout] 308 + .as_str(), [INFO] [stdout] 309 + ); [INFO] [stdout] 310 + Ok(Self::Yield(y)) [INFO] [stdout] 311 + } [INFO] [stdout] 312 + "YieldFrom" => { [INFO] [stdout] 313 + let yf = ob.extract().expect( [INFO] [stdout] 314 + ob.error_message( [INFO] [stdout] 315 + "", [INFO] [stdout] 316 + format!("extracting YieldFrom in expression {}", dump(ob, None)?), [INFO] [stdout] 317 + ) [INFO] [stdout] 318 + .as_str(), [INFO] [stdout] 319 + ); [INFO] [stdout] 320 + Ok(Self::YieldFrom(yf)) [INFO] [stdout] 321 + } [INFO] [stdout] 322 + "JoinedStr" => { [INFO] [stdout] 323 + let js = ob.extract().expect( [INFO] [stdout] 324 + ob.error_message( [INFO] [stdout] 325 + "", [INFO] [stdout] 326 + format!("extracting JoinedStr in expression {}", dump(ob, None)?), [INFO] [stdout] 327 + ) [INFO] [stdout] 328 + .as_str(), [INFO] [stdout] 329 + ); [INFO] [stdout] 330 + Ok(Self::JoinedStr(js)) [INFO] [stdout] 331 + } [INFO] [stdout] 332 + "FormattedValue" => { [INFO] [stdout] 333 + let fv = ob.extract().expect( [INFO] [stdout] 334 + ob.error_message( [INFO] [stdout] 335 + "", [INFO] [stdout] 336 + format!("extracting FormattedValue in expression {}", dump(ob, None)?), [INFO] [stdout] 337 + ) [INFO] [stdout] 338 + .as_str(), [INFO] [stdout] 339 + ); [INFO] [stdout] 340 + Ok(Self::FormattedValue(fv)) [INFO] [stdout] 341 + } [INFO] [stdout] 342 + _ => { [INFO] [stdout] 343 + let err_msg = format!( [INFO] [stdout] 344 + "Unimplemented expression type {}, {}", [INFO] [stdout] 345 + expr_type, [INFO] [stdout] 346 + dump(ob, None)? [INFO] [stdout] 347 + ); [INFO] [stdout] 348 + Err(pyo3::exceptions::PyValueError::new_err( [INFO] [stdout] 349 + ob.error_message("", err_msg.as_str()), [INFO] [stdout] 350 + )) [INFO] [stdout] 351 + } [INFO] [stdout] 352 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:72:46 [INFO] [stdout] | [INFO] [stdout] 72 | let expr_type = ob.get_type().name().expect( [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 73 | | ob.error_message( [INFO] [stdout] 74 | | "", [INFO] [stdout] 75 | | format!("extracting type name {:?} in expression", dump(ob, None)), [INFO] [stdout] 76 | | ) [INFO] [stdout] 77 | | .as_str(), [INFO] [stdout] 78 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 72 ~ let expr_type = ob.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 73 + "", [INFO] [stdout] 74 + format!("extracting type name {:?} in expression", dump(ob, None)), [INFO] [stdout] 75 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/ast/tree/expression.rs:356:6 [INFO] [stdout] | [INFO] [stdout] 356 | impl<'a> CodeGen for ExprType { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:398:26 [INFO] [stdout] | [INFO] [stdout] 398 | .expect(format!("Extracting list item {:?}", li).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Extracting list item {:?}", li))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:495:14 [INFO] [stdout] | [INFO] [stdout] 495 | .expect(ob.error_message("", err_msg.as_str()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", err_msg.as_str())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:514:52 [INFO] [stdout] | [INFO] [stdout] 514 | let expr_type = ob_value.get_type().name().expect( [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 515 | | ob.error_message( [INFO] [stdout] 516 | | "", [INFO] [stdout] 517 | | format!("extracting type name {:?} in expression", ob_value), [INFO] [stdout] 518 | | ) [INFO] [stdout] 519 | | .as_str(), [INFO] [stdout] 520 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 514 ~ let expr_type = ob_value.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 515 + "", [INFO] [stdout] 516 + format!("extracting type name {:?} in expression", ob_value), [INFO] [stdout] 517 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:572:45 [INFO] [stdout] | [INFO] [stdout] 572 | let et = ob_value.extract().expect( [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 573 | | ob.error_message( [INFO] [stdout] 574 | | "", [INFO] [stdout] 575 | | format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 576 | | ) [INFO] [stdout] 577 | | .as_str(), [INFO] [stdout] 578 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 572 ~ let et = ob_value.extract().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 573 + "", [INFO] [stdout] 574 + format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 575 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:621:26 [INFO] [stdout] | [INFO] [stdout] 621 | .expect(&format!("extracting list element {}", dump(&elt, None).unwrap_or_else(|_| "unknown".to_string()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("extracting list element {}", dump(&elt, None).unwrap_or_else(|_| "unknown".to_string())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/expression.rs:629:47 [INFO] [stdout] | [INFO] [stdout] 629 | let name = ob_value.extract().expect( [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 630 | | ob.error_message( [INFO] [stdout] 631 | | "", [INFO] [stdout] 632 | | format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 633 | | ) [INFO] [stdout] 634 | | .as_str(), [INFO] [stdout] 635 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 629 ~ let name = ob_value.extract().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 630 + "", [INFO] [stdout] 631 + format!("parsing Call expression {:?}", ob_value), [INFO] [stdout] 632 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/ast/tree/expression.rs:903:9 [INFO] [stdout] | [INFO] [stdout] 903 | options.with_std_python = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { with_std_python: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/ast/tree/expression.rs:902:9 [INFO] [stdout] | [INFO] [stdout] 902 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/function_def.rs:86:14 [INFO] [stdout] | [INFO] [stdout] 86 | .expect(format!("parsing arguments {:?}", self.args).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing arguments {:?}", self.args))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/function_def.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | .expect(format!("parsing statement {:?}", s).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing statement {:?}", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/function_def.rs:105:40 [INFO] [stdout] | [INFO] [stdout] 105 | let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/function_def.rs:183:36 [INFO] [stdout] | [INFO] [stdout] 183 | formatted.push(format!("```rust")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"```rust".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/codegen/python_options.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for AsyncRuntime { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | AsyncRuntime::Tokio [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 14 + #[derive(Default)] [INFO] [stdout] 15 | pub enum AsyncRuntime { [INFO] [stdout] 16 | /// Tokio runtime (default) [INFO] [stdout] 17 ~ #[default] [INFO] [stdout] 18 ~ Tokio, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | options.async_runtime = AsyncRuntime::Tokio; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Tokio, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:117:9 [INFO] [stdout] | [INFO] [stdout] 117 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | options.async_runtime = AsyncRuntime::AsyncStd; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | options.async_runtime = AsyncRuntime::Smol; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Smol, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | / options.async_runtime = AsyncRuntime::Custom { [INFO] [stdout] 140 | | attribute: attribute.into(), [INFO] [stdout] 141 | | import: import.into(), [INFO] [stdout] 142 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Custom { [INFO] [stdout] attribute: attribute.into(), [INFO] [stdout] import: import.into(), [INFO] [stdout] }, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/parser/mod.rs:49:77 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn parse_enhanced(input: impl AsRef, filename: impl AsRef) -> CrateResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/result.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] 96 | | message: String, [INFO] [stdout] 97 | | help: String, [INFO] [stdout] 98 | | }, [INFO] [stdout] | |_____- the variant `ParseError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 101 | / CodeGenError { [INFO] [stdout] 102 | | location: SourceLocation, [INFO] [stdout] 103 | | message: String, [INFO] [stdout] 104 | | help: String, [INFO] [stdout] 105 | | }, [INFO] [stdout] | |_____- the variant `CodeGenError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 108 | / UnsupportedFeature { [INFO] [stdout] 109 | | location: SourceLocation, [INFO] [stdout] 110 | | feature: String, [INFO] [stdout] 111 | | help: String, [INFO] [stdout] 112 | | }, [INFO] [stdout] | |_____- the variant `UnsupportedFeature` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 115 | / TypeError { [INFO] [stdout] 116 | | location: SourceLocation, [INFO] [stdout] 117 | | message: String, [INFO] [stdout] 118 | | expected: String, [INFO] [stdout] 119 | | found: String, [INFO] [stdout] 120 | | help: String, [INFO] [stdout] 121 | | }, [INFO] [stdout] | |_____- the variant `TypeError` contains at least 184 bytes [INFO] [stdout] ... [INFO] [stdout] 124 | / SyntaxError { [INFO] [stdout] 125 | | location: SourceLocation, [INFO] [stdout] 126 | | message: String, [INFO] [stdout] 127 | | help: String, [INFO] [stdout] 128 | | }, [INFO] [stdout] | |_____- the variant `SyntaxError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 141 | ExprNotYetImplemented(Expr), [INFO] [stdout] | --------------------------- the variant `ExprNotYetImplemented` contains at least 520 bytes [INFO] [stdout] 142 | #[error("ExprType type not yet implemented: {:?}", .0)] [INFO] [stdout] 143 | ExprTypeNotYetImplemented(ExprType), [INFO] [stdout] | ----------------------------------- the variant `ExprTypeNotYetImplemented` contains at least 432 bytes [INFO] [stdout] ... [INFO] [stdout] 153 | StatementNotYetImplemented(StatementType), [INFO] [stdout] | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `result::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this closure is very large [INFO] [stdout] --> src/parser/mod.rs:56:47 [INFO] [stdout] | [INFO] [stdout] 56 | let mut module: Module = Python::with_gil(|py| { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 57 | | let py_tree = parse_to_py(input_str, filename, py) [INFO] [stdout] 58 | | .map_err(|py_err| { [INFO] [stdout] ... | [INFO] [stdout] 79 | | }) [INFO] [stdout] 80 | | })?; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] ::: src/result.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] 96 | | message: String, [INFO] [stdout] 97 | | help: String, [INFO] [stdout] 98 | | }, [INFO] [stdout] | |_____- the variant `ParseError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 101 | / CodeGenError { [INFO] [stdout] 102 | | location: SourceLocation, [INFO] [stdout] 103 | | message: String, [INFO] [stdout] 104 | | help: String, [INFO] [stdout] 105 | | }, [INFO] [stdout] | |_____- the variant `CodeGenError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 108 | / UnsupportedFeature { [INFO] [stdout] 109 | | location: SourceLocation, [INFO] [stdout] 110 | | feature: String, [INFO] [stdout] 111 | | help: String, [INFO] [stdout] 112 | | }, [INFO] [stdout] | |_____- the variant `UnsupportedFeature` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 115 | / TypeError { [INFO] [stdout] 116 | | location: SourceLocation, [INFO] [stdout] 117 | | message: String, [INFO] [stdout] 118 | | expected: String, [INFO] [stdout] 119 | | found: String, [INFO] [stdout] 120 | | help: String, [INFO] [stdout] 121 | | }, [INFO] [stdout] | |_____- the variant `TypeError` contains at least 184 bytes [INFO] [stdout] ... [INFO] [stdout] 124 | / SyntaxError { [INFO] [stdout] 125 | | location: SourceLocation, [INFO] [stdout] 126 | | message: String, [INFO] [stdout] 127 | | help: String, [INFO] [stdout] 128 | | }, [INFO] [stdout] | |_____- the variant `SyntaxError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 141 | ExprNotYetImplemented(Expr), [INFO] [stdout] | --------------------------- the variant `ExprNotYetImplemented` contains at least 520 bytes [INFO] [stdout] 142 | #[error("ExprType type not yet implemented: {:?}", .0)] [INFO] [stdout] 143 | ExprTypeNotYetImplemented(ExprType), [INFO] [stdout] | ----------------------------------- the variant `ExprTypeNotYetImplemented` contains at least 432 bytes [INFO] [stdout] ... [INFO] [stdout] 153 | StatementNotYetImplemented(StatementType), [INFO] [stdout] | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `result::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/result.rs:92:1 [INFO] [stdout] | [INFO] [stdout] 92 | / pub enum Error { [INFO] [stdout] 93 | | #[error("Parsing error at {location}: {message}\nHelp: {help}")] [INFO] [stdout] 94 | | ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] ... | [INFO] [stdout] 141 | | ExprNotYetImplemented(Expr), [INFO] [stdout] | | --------------------------- the second-largest variant contains at least 520 bytes [INFO] [stdout] ... | [INFO] [stdout] 153 | | StatementNotYetImplemented(StatementType), [INFO] [stdout] | | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] ... | [INFO] [stdout] 159 | | UnknownError(Box), [INFO] [stdout] 160 | | } [INFO] [stdout] | |_^ the entire enum is at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 153 - StatementNotYetImplemented(StatementType), [INFO] [stdout] 153 + StatementNotYetImplemented(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/ast/tree/name.rs:35:1 [INFO] [stdout] | [INFO] [stdout] 35 | impl Into for Identifier { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 35 ~ impl From for String { [INFO] [stdout] 36 ~ fn from(val: Identifier) -> Self { [INFO] [stdout] 37 ~ val.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/ast/tree/name.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | impl Into for Name { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 70 ~ impl From for String { [INFO] [stdout] 71 ~ fn from(val: Name) -> Self { [INFO] [stdout] 72 ~ val.id [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/named_expression.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | .expect(format!("parsing left side of named expression {:?}", self.left).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing left side of named expression {:?}", self.left))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/named_expression.rs:43:63 [INFO] [stdout] | [INFO] [stdout] 43 | self.right.clone().to_rust(ctx, options, symbols).expect( [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 44 | | format!("parsing right side of named expression {:?}", self.right).as_str(), [INFO] [stdout] 45 | | ); [INFO] [stdout] | |_____________^ help: try: `unwrap_or_else(|_| panic!("parsing right side of named expression {:?}", self.right))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/tree/unary_op.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / return Ok(UnaryOp { [INFO] [stdout] 76 | | op: op, [INFO] [stdout] 77 | | operand: Box::new(operand), [INFO] [stdout] 78 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 75 ~ Ok(UnaryOp { [INFO] [stdout] 76 + op: op, [INFO] [stdout] 77 + operand: Box::new(operand), [INFO] [stdout] 78 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:41:52 [INFO] [stdout] | [INFO] [stdout] 41 | let op = ob.as_unbound().getattr(py, "op").expect( [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 42 | | ob.error_message("", "error getting unary operator") [INFO] [stdout] 43 | | .as_str(), [INFO] [stdout] 44 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operator")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:47:50 [INFO] [stdout] | [INFO] [stdout] 47 | let op_type = bound_op.get_type().name().expect( [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 48 | | ob.error_message( [INFO] [stdout] 49 | | "", [INFO] [stdout] 50 | | format!("extracting type name {:?} for unary operator", op), [INFO] [stdout] 51 | | ) [INFO] [stdout] 52 | | .as_str(), [INFO] [stdout] 53 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ let op_type = bound_op.get_type().name().unwrap_or_else(|_| panic!("{}", ob.error_message( [INFO] [stdout] 48 + "", [INFO] [stdout] 49 + format!("extracting type name {:?} for unary operator", op), [INFO] [stdout] 50 ~ ))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/unary_op.rs:55:62 [INFO] [stdout] | [INFO] [stdout] 55 | let operand = ob.as_unbound().getattr(py, "operand").expect( [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 56 | | ob.error_message("", "error getting unary operand") [INFO] [stdout] 57 | | .as_str(), [INFO] [stdout] 58 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("{}", ob.error_message("", "error getting unary operand")))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ast/tree/unary_op.rs:71:41 [INFO] [stdout] | [INFO] [stdout] 71 | log::debug!("operand: {}", dump(&operand.bind(py), None)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `operand.bind(py)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/ast/tree/module.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | ... let doc_line = format!("{}", line); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `line.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/module.rs:165:18 [INFO] [stdout] | [INFO] [stdout] 165 | .expect(format!("parsing statement {:?} in module", s).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("parsing statement {:?} in module", s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:207:30 [INFO] [stdout] | [INFO] [stdout] 207 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 208 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 208 - .unwrap_or_else(|_| stream); [INFO] [stdout] 208 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:215:34 [INFO] [stdout] | [INFO] [stdout] 215 | stream = renamed_stream_str.parse::() [INFO] [stdout] | __________________________________^ [INFO] [stdout] 216 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 216 - .unwrap_or_else(|_| stream); [INFO] [stdout] 216 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:230:30 [INFO] [stdout] | [INFO] [stdout] 230 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 231 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 231 - .unwrap_or_else(|_| stream); [INFO] [stdout] 231 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:237:34 [INFO] [stdout] | [INFO] [stdout] 237 | stream = renamed_stream_str.parse::() [INFO] [stdout] | __________________________________^ [INFO] [stdout] 238 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 238 - .unwrap_or_else(|_| stream); [INFO] [stdout] 238 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/ast/tree/module.rs:256:30 [INFO] [stdout] | [INFO] [stdout] 256 | stream = new_stream_str.parse::() [INFO] [stdout] | ______________________________^ [INFO] [stdout] 257 | | .unwrap_or_else(|_| stream); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 257 - .unwrap_or_else(|_| stream); [INFO] [stdout] 257 + .unwrap_or(stream); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ast/tree/module.rs:263:25 [INFO] [stdout] | [INFO] [stdout] 263 | / if updated_stmt_str != stmt_str { [INFO] [stdout] 264 | | if let Ok(new_stmt) = updated_stmt_str.parse::() { [INFO] [stdout] 265 | | *stmt = new_stmt; [INFO] [stdout] 266 | | } [INFO] [stdout] 267 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 263 ~ if updated_stmt_str != stmt_str [INFO] [stdout] 264 ~ && let Ok(new_stmt) = updated_stmt_str.parse::() { [INFO] [stdout] 265 | *stmt = new_stmt; [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ast/tree/module.rs:350:38 [INFO] [stdout] | [INFO] [stdout] 350 | call.args.iter().any(|arg| Self::is_main_function_call(arg)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Self::is_main_function_call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ast/tree/module.rs:531:9 [INFO] [stdout] | [INFO] [stdout] 531 | / if let StatementType::Expr(expr) = &first_stmt.statement { [INFO] [stdout] 532 | | if let ExprType::Constant(c) = &expr.value { [INFO] [stdout] 533 | | let raw_string = c.to_string(); [INFO] [stdout] 534 | | let content = raw_string.trim_matches('"'); [INFO] [stdout] ... | [INFO] [stdout] 545 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 531 ~ if let StatementType::Expr(expr) = &first_stmt.statement [INFO] [stdout] 532 ~ && let ExprType::Constant(c) = &expr.value { [INFO] [stdout] 533 | let raw_string = c.to_string(); [INFO] [stdout] ... [INFO] [stdout] 543 | || content.len() > 50; // Longer strings are more likely to be docstrings [INFO] [stdout] 544 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/statement.rs:73:14 [INFO] [stdout] | [INFO] [stdout] 73 | .expect( [INFO] [stdout] | ______________^ [INFO] [stdout] 74 | | self.error_message( [INFO] [stdout] 75 | | "", [INFO] [stdout] 76 | | format!("failed to compile statement {:#?}", self), [INFO] [stdout] 77 | | ) [INFO] [stdout] 78 | | .as_str(), [INFO] [stdout] 79 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 ~ .unwrap_or_else(|_| panic!("{}", self.error_message( [INFO] [stdout] 74 + "", [INFO] [stdout] 75 + format!("failed to compile statement {:#?}", self), [INFO] [stdout] 76 ~ )))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/ast/tree/statement.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | .expect(format!("Expr {:?}", ob).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Expr {:?}", ob))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/ast/tree/statement.rs:334:9 [INFO] [stdout] | [INFO] [stdout] 334 | assert_eq!(tokens.unwrap().is_empty(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 334 - assert_eq!(tokens.unwrap().is_empty(), true); [INFO] [stdout] 334 + assert!(tokens.unwrap().is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/ast/tree/statement.rs:348:9 [INFO] [stdout] | [INFO] [stdout] 348 | assert_eq!(tokens.unwrap().is_empty(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 348 - assert_eq!(tokens.unwrap().is_empty(), false); [INFO] [stdout] 348 + assert!(!tokens.unwrap().is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/ast/tree/statement.rs:362:9 [INFO] [stdout] | [INFO] [stdout] 362 | assert_eq!(tokens.unwrap().is_empty(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 362 - assert_eq!(tokens.unwrap().is_empty(), false); [INFO] [stdout] 362 + assert!(!tokens.unwrap().is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/test_async_improvements.rs:35:101 [INFO] [stdout] | [INFO] [stdout] 35 | if code_str.contains("# [tokio :: main]") && code_str.contains("async fn main") { [INFO] [stdout] | _____________________________________________________________________________________________________^ [INFO] [stdout] 36 | | println!("✅ Async main function with tokio::main detected"); [INFO] [stdout] 37 | | } else if code_str.contains("#[tokio::main]") && code_str.contains("async fn main") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/test_async_improvements.rs:37:105 [INFO] [stdout] | [INFO] [stdout] 37 | } else if code_str.contains("#[tokio::main]") && code_str.contains("async fn main") { [INFO] [stdout] | _________________________________________________________________________________________________________^ [INFO] [stdout] 38 | | println!("✅ Async main function with tokio::main detected"); [INFO] [stdout] 39 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> tests/rython_stdpython_integration.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | options.with_std_python = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { with_std_python: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> tests/rython_stdpython_integration.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_original_file.rs:31:31 [INFO] [stdout] | [INFO] [stdout] 31 | .args(&["--crate-type", "lib", temp_file]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["--crate-type", "lib", temp_file]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/bin/simple_test.rs:16:42 [INFO] [stdout] | [INFO] [stdout] 16 | println!("{}", tokens.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/bin/simple_test.rs:16:42 [INFO] [stdout] | [INFO] [stdout] 16 | println!("{}", tokens.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/final_test.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | match parse(&code, "example.py") { [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/codegen/python_options.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for AsyncRuntime { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | AsyncRuntime::Tokio [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 14 + #[derive(Default)] [INFO] [stdout] 15 | pub enum AsyncRuntime { [INFO] [stdout] 16 | /// Tokio runtime (default) [INFO] [stdout] 17 ~ #[default] [INFO] [stdout] 18 ~ Tokio, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | options.async_runtime = AsyncRuntime::Tokio; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Tokio, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:117:9 [INFO] [stdout] | [INFO] [stdout] 117 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | options.async_runtime = AsyncRuntime::AsyncStd; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | options.async_runtime = AsyncRuntime::Smol; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Smol, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/codegen/python_options.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | / options.async_runtime = AsyncRuntime::Custom { [INFO] [stdout] 140 | | attribute: attribute.into(), [INFO] [stdout] 141 | | import: import.into(), [INFO] [stdout] 142 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `codegen::python_options::PythonOptions { async_runtime: AsyncRuntime::Custom { [INFO] [stdout] attribute: attribute.into(), [INFO] [stdout] import: import.into(), [INFO] [stdout] }, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/codegen/python_options.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | let mut options = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/isidentifier/mod.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | assert_eq!(isidentifier("alpha").unwrap(), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 55 - assert_eq!(isidentifier("alpha").unwrap(), true) [INFO] [stdout] 55 + assert!(isidentifier("alpha").unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/isidentifier/mod.rs:60:9 [INFO] [stdout] | [INFO] [stdout] 60 | assert_eq!(isidentifier("alpha").unwrap(), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 60 - assert_eq!(isidentifier("alpha").unwrap(), true) [INFO] [stdout] 60 + assert!(isidentifier("alpha").unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/isidentifier/mod.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | assert_eq!(isidentifier("0alpha").unwrap(), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 65 - assert_eq!(isidentifier("0alpha").unwrap(), false) [INFO] [stdout] 65 + assert!(!isidentifier("0alpha").unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/isidentifier/mod.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | assert_eq!("0alpha".isidentifier().unwrap(), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 70 - assert_eq!("0alpha".isidentifier().unwrap(), false) [INFO] [stdout] 70 + assert!(!"0alpha".isidentifier().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/parser/mod.rs:49:77 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn parse_enhanced(input: impl AsRef, filename: impl AsRef) -> CrateResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/result.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] 96 | | message: String, [INFO] [stdout] 97 | | help: String, [INFO] [stdout] 98 | | }, [INFO] [stdout] | |_____- the variant `ParseError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 101 | / CodeGenError { [INFO] [stdout] 102 | | location: SourceLocation, [INFO] [stdout] 103 | | message: String, [INFO] [stdout] 104 | | help: String, [INFO] [stdout] 105 | | }, [INFO] [stdout] | |_____- the variant `CodeGenError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 108 | / UnsupportedFeature { [INFO] [stdout] 109 | | location: SourceLocation, [INFO] [stdout] 110 | | feature: String, [INFO] [stdout] 111 | | help: String, [INFO] [stdout] 112 | | }, [INFO] [stdout] | |_____- the variant `UnsupportedFeature` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 115 | / TypeError { [INFO] [stdout] 116 | | location: SourceLocation, [INFO] [stdout] 117 | | message: String, [INFO] [stdout] 118 | | expected: String, [INFO] [stdout] 119 | | found: String, [INFO] [stdout] 120 | | help: String, [INFO] [stdout] 121 | | }, [INFO] [stdout] | |_____- the variant `TypeError` contains at least 184 bytes [INFO] [stdout] ... [INFO] [stdout] 124 | / SyntaxError { [INFO] [stdout] 125 | | location: SourceLocation, [INFO] [stdout] 126 | | message: String, [INFO] [stdout] 127 | | help: String, [INFO] [stdout] 128 | | }, [INFO] [stdout] | |_____- the variant `SyntaxError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 141 | ExprNotYetImplemented(Expr), [INFO] [stdout] | --------------------------- the variant `ExprNotYetImplemented` contains at least 520 bytes [INFO] [stdout] 142 | #[error("ExprType type not yet implemented: {:?}", .0)] [INFO] [stdout] 143 | ExprTypeNotYetImplemented(ExprType), [INFO] [stdout] | ----------------------------------- the variant `ExprTypeNotYetImplemented` contains at least 432 bytes [INFO] [stdout] ... [INFO] [stdout] 153 | StatementNotYetImplemented(StatementType), [INFO] [stdout] | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `result::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this closure is very large [INFO] [stdout] --> src/parser/mod.rs:56:47 [INFO] [stdout] | [INFO] [stdout] 56 | let mut module: Module = Python::with_gil(|py| { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 57 | | let py_tree = parse_to_py(input_str, filename, py) [INFO] [stdout] 58 | | .map_err(|py_err| { [INFO] [stdout] ... | [INFO] [stdout] 79 | | }) [INFO] [stdout] 80 | | })?; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] ::: src/result.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] 96 | | message: String, [INFO] [stdout] 97 | | help: String, [INFO] [stdout] 98 | | }, [INFO] [stdout] | |_____- the variant `ParseError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 101 | / CodeGenError { [INFO] [stdout] 102 | | location: SourceLocation, [INFO] [stdout] 103 | | message: String, [INFO] [stdout] 104 | | help: String, [INFO] [stdout] 105 | | }, [INFO] [stdout] | |_____- the variant `CodeGenError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 108 | / UnsupportedFeature { [INFO] [stdout] 109 | | location: SourceLocation, [INFO] [stdout] 110 | | feature: String, [INFO] [stdout] 111 | | help: String, [INFO] [stdout] 112 | | }, [INFO] [stdout] | |_____- the variant `UnsupportedFeature` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 115 | / TypeError { [INFO] [stdout] 116 | | location: SourceLocation, [INFO] [stdout] 117 | | message: String, [INFO] [stdout] 118 | | expected: String, [INFO] [stdout] 119 | | found: String, [INFO] [stdout] 120 | | help: String, [INFO] [stdout] 121 | | }, [INFO] [stdout] | |_____- the variant `TypeError` contains at least 184 bytes [INFO] [stdout] ... [INFO] [stdout] 124 | / SyntaxError { [INFO] [stdout] 125 | | location: SourceLocation, [INFO] [stdout] 126 | | message: String, [INFO] [stdout] 127 | | help: String, [INFO] [stdout] 128 | | }, [INFO] [stdout] | |_____- the variant `SyntaxError` contains at least 136 bytes [INFO] [stdout] ... [INFO] [stdout] 141 | ExprNotYetImplemented(Expr), [INFO] [stdout] | --------------------------- the variant `ExprNotYetImplemented` contains at least 520 bytes [INFO] [stdout] 142 | #[error("ExprType type not yet implemented: {:?}", .0)] [INFO] [stdout] 143 | ExprTypeNotYetImplemented(ExprType), [INFO] [stdout] | ----------------------------------- the variant `ExprTypeNotYetImplemented` contains at least 432 bytes [INFO] [stdout] ... [INFO] [stdout] 153 | StatementNotYetImplemented(StatementType), [INFO] [stdout] | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `result::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/test_async_improvements.rs:35:101 [INFO] [stdout] | [INFO] [stdout] 35 | if code_str.contains("# [tokio :: main]") && code_str.contains("async fn main") { [INFO] [stdout] | _____________________________________________________________________________________________________^ [INFO] [stdout] 36 | | println!("✅ Async main function with tokio::main detected"); [INFO] [stdout] 37 | | } else if code_str.contains("#[tokio::main]") && code_str.contains("async fn main") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/test_async_improvements.rs:37:105 [INFO] [stdout] | [INFO] [stdout] 37 | } else if code_str.contains("#[tokio::main]") && code_str.contains("async fn main") { [INFO] [stdout] | _________________________________________________________________________________________________________^ [INFO] [stdout] 38 | | println!("✅ Async main function with tokio::main detected"); [INFO] [stdout] 39 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/result.rs:92:1 [INFO] [stdout] | [INFO] [stdout] 92 | / pub enum Error { [INFO] [stdout] 93 | | #[error("Parsing error at {location}: {message}\nHelp: {help}")] [INFO] [stdout] 94 | | ParseError { [INFO] [stdout] 95 | | location: SourceLocation, [INFO] [stdout] ... | [INFO] [stdout] 141 | | ExprNotYetImplemented(Expr), [INFO] [stdout] | | --------------------------- the second-largest variant contains at least 520 bytes [INFO] [stdout] ... | [INFO] [stdout] 153 | | StatementNotYetImplemented(StatementType), [INFO] [stdout] | | ----------------------------------------- the largest variant contains at least 984 bytes [INFO] [stdout] ... | [INFO] [stdout] 159 | | UnknownError(Box), [INFO] [stdout] 160 | | } [INFO] [stdout] | |_^ the entire enum is at least 984 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 153 - StatementNotYetImplemented(StatementType), [INFO] [stdout] 153 + StatementNotYetImplemented(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap()` on `Ok` value [INFO] [stdout] --> src/result.rs:292:20 [INFO] [stdout] | [INFO] [stdout] 292 | assert_eq!(result.unwrap(), 42); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap()` [INFO] [stdout] --> src/result.rs:290:35 [INFO] [stdout] | [INFO] [stdout] 290 | let result: Result = Ok(42); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/datamodel/mod.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | assert_eq!(x.is(&None), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 158 - assert_eq!(x.is(&None), true); [INFO] [stdout] 158 + assert!(x.is(&None)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_ne!` with a literal bool [INFO] [stdout] --> src/datamodel/mod.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | assert_ne!(x.is(&NotImplemented), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 159 - assert_ne!(x.is(&NotImplemented), true); [INFO] [stdout] 159 + assert!(!x.is(&NotImplemented)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/datamodel/mod.rs:160:9 [INFO] [stdout] | [INFO] [stdout] 160 | assert_eq!(y.is(&None), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 160 - assert_eq!(y.is(&None), true); [INFO] [stdout] 160 + assert!(y.is(&None)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_ne!` with a literal bool [INFO] [stdout] --> src/datamodel/mod.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | assert_ne!(y.is(&NotImplemented), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 161 - assert_ne!(y.is(&NotImplemented), true); [INFO] [stdout] 161 + assert!(!y.is(&NotImplemented)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/parser_utils.rs:154:1 [INFO] [stdout] | [INFO] [stdout] 154 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 199 | / pub fn get_attr_with_context<'a>( [INFO] [stdout] 200 | | ob: &Bound<'a, PyAny>, [INFO] [stdout] 201 | | attr_name: &str, [INFO] [stdout] 202 | | context: &str, [INFO] [stdout] 203 | | ) -> PyResult> { [INFO] [stdout] | |_______________________________^ [INFO] [stdout] ... [INFO] [stdout] 220 | / pub fn extract_with_context<'py, T>( [INFO] [stdout] 221 | | value: &Bound<'py, PyAny>, [INFO] [stdout] 222 | | context: &str, [INFO] [stdout] 223 | | attr_name: &str, [INFO] [stdout] 224 | | ) -> PyResult [INFO] [stdout] 225 | | where [INFO] [stdout] 226 | | T: pyo3::FromPyObject<'py>, [INFO] [stdout] | |_______________________________^ [INFO] [stdout] ... [INFO] [stdout] 245 | / pub fn extract_required_attr<'py, T>( [INFO] [stdout] 246 | | ob: &Bound<'py, PyAny>, [INFO] [stdout] 247 | | attr_name: &str, [INFO] [stdout] 248 | | context: &str, [INFO] [stdout] 249 | | ) -> PyResult [INFO] [stdout] 250 | | where [INFO] [stdout] 251 | | T: pyo3::FromPyObject<'py>, [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_parse.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | match parse(&code, "test_comprehensive.py") { [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> tests/common/mod.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / /// Test utility functions for the python-ast library tests. [INFO] [stdout] 4 | | [INFO] [stdout] | |_^ [INFO] [stdout] 5 | /// Asserts that parsing the given code succeeds and returns a module. [INFO] [stdout] 6 | pub fn assert_parse_success(code: &str, filename: &str) -> Module { [INFO] [stdout] | --------------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 4 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_final_solution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | .args(&["--crate-type", "lib", temp_file]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["--crate-type", "lib", temp_file]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_final_solution.rs:86:25 [INFO] [stdout] | [INFO] [stdout] 86 | / if !trimmed.is_empty() { [INFO] [stdout] 87 | | if trimmed.starts_with("use ") || [INFO] [stdout] 88 | | trimmed.starts_with("pub fn ") || [INFO] [stdout] 89 | | trimmed.starts_with("fn main") { [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if !trimmed.is_empty() [INFO] [stdout] 87 ~ && (trimmed.starts_with("use ") || [INFO] [stdout] 88 | trimmed.starts_with("pub fn ") || [INFO] [stdout] 89 ~ trimmed.starts_with("fn main")) { [INFO] [stdout] 90 | println!("{:2}: {}", i + 1, trimmed); [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_convenience_methods.rs:31:25 [INFO] [stdout] | [INFO] [stdout] 31 | / if let Some(attr_start) = code_str.find("# [") { [INFO] [stdout] 32 | | if let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 33 | | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 34 | | println!(" ✅ Attribute: {}", attr_section); [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 31 ~ if let Some(attr_start) = code_str.find("# [") [INFO] [stdout] 32 ~ && let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 33 | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 34 | println!(" ✅ Attribute: {}", attr_section); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_async_runtimes.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | options.async_runtime = runtime; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: runtime, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_async_runtimes.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_async_runtimes.rs:43:25 [INFO] [stdout] | [INFO] [stdout] 43 | / if let Some(import_start) = code_str.find("use ") { [INFO] [stdout] 44 | | if let Some(import_end) = code_str[import_start..].find(" ;") { [INFO] [stdout] 45 | | let import_section = &code_str[import_start..import_start + import_end + 2]; [INFO] [stdout] 46 | | println!(" Import: {}", import_section); [INFO] [stdout] 47 | | } [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(import_start) = code_str.find("use ") [INFO] [stdout] 44 ~ && let Some(import_end) = code_str[import_start..].find(" ;") { [INFO] [stdout] 45 | let import_section = &code_str[import_start..import_start + import_end + 2]; [INFO] [stdout] 46 | println!(" Import: {}", import_section); [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_async_runtimes.rs:50:25 [INFO] [stdout] | [INFO] [stdout] 50 | / if let Some(attr_start) = code_str.find("# [") { [INFO] [stdout] 51 | | if let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 52 | | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 53 | | println!(" Attribute: {}", attr_section); [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 50 ~ if let Some(attr_start) = code_str.find("# [") [INFO] [stdout] 51 ~ && let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 52 | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 53 | println!(" Attribute: {}", attr_section); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_async_runtimes.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | options.async_runtime = AsyncRuntime::AsyncStd; // Use non-default to verify it doesn't affect sync code [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_async_runtimes.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_async_runtimes.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | options.async_runtime = runtime; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: runtime, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_async_runtimes.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_detailed_output.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | options.async_runtime = AsyncRuntime::AsyncStd; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_detailed_output.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_async_runtimes.rs:43:25 [INFO] [stdout] | [INFO] [stdout] 43 | / if let Some(import_start) = code_str.find("use ") { [INFO] [stdout] 44 | | if let Some(import_end) = code_str[import_start..].find(" ;") { [INFO] [stdout] 45 | | let import_section = &code_str[import_start..import_start + import_end + 2]; [INFO] [stdout] 46 | | println!(" Import: {}", import_section); [INFO] [stdout] 47 | | } [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(import_start) = code_str.find("use ") [INFO] [stdout] 44 ~ && let Some(import_end) = code_str[import_start..].find(" ;") { [INFO] [stdout] 45 | let import_section = &code_str[import_start..import_start + import_end + 2]; [INFO] [stdout] 46 | println!(" Import: {}", import_section); [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_async_runtimes.rs:50:25 [INFO] [stdout] | [INFO] [stdout] 50 | / if let Some(attr_start) = code_str.find("# [") { [INFO] [stdout] 51 | | if let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 52 | | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 53 | | println!(" Attribute: {}", attr_section); [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 50 ~ if let Some(attr_start) = code_str.find("# [") [INFO] [stdout] 51 ~ && let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 52 | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 53 | println!(" Attribute: {}", attr_section); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_async_runtimes.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | options.async_runtime = AsyncRuntime::AsyncStd; // Use non-default to verify it doesn't affect sync code [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_async_runtimes.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/bin/test_error_handling.rs:1:50 [INFO] [stdout] | [INFO] [stdout] 1 | use python_ast::{parse_enhanced, SourceLocation, Error}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/final_test.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | match parse(&code, "example.py") { [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/comprehensive_test.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | options.async_runtime = runtime.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: runtime.clone(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/comprehensive_test.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_convenience_methods.rs:31:25 [INFO] [stdout] | [INFO] [stdout] 31 | / if let Some(attr_start) = code_str.find("# [") { [INFO] [stdout] 32 | | if let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 33 | | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 34 | | println!(" ✅ Attribute: {}", attr_section); [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 31 ~ if let Some(attr_start) = code_str.find("# [") [INFO] [stdout] 32 ~ && let Some(attr_end) = code_str[attr_start..].find("]") { [INFO] [stdout] 33 | let attr_section = &code_str[attr_start..attr_start + attr_end + 1]; [INFO] [stdout] 34 | println!(" ✅ Attribute: {}", attr_section); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/common/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / match parse(code, filename) { [INFO] [stdout] 20 | | Ok(_) => panic!("Expected parsing to fail, but it succeeded"), [INFO] [stdout] 21 | | Err(_) => (), // Expected failure [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____^ help: try: `if let Ok(_) = parse(code, filename) { panic!("Expected parsing to fail, but it succeeded") }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> examples/async_runtime_example.rs:68:21 [INFO] [stdout] | [INFO] [stdout] 68 | / if let Some(main_start) = code_str.find("# [") { [INFO] [stdout] 69 | | if let Some(main_end) = code_str[main_start..].find("async fn main") { [INFO] [stdout] 70 | | if let Some(brace) = code_str[main_start + main_end..].find(" {") { [INFO] [stdout] 71 | | let main_signature = &code_str[main_start..main_start + main_end + brace + 2]; [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 68 ~ if let Some(main_start) = code_str.find("# [") [INFO] [stdout] 69 ~ && let Some(main_end) = code_str[main_start..].find("async fn main") { [INFO] [stdout] 70 | if let Some(brace) = code_str[main_start + main_end..].find(" {") { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> examples/async_runtime_example.rs:69:25 [INFO] [stdout] | [INFO] [stdout] 69 | / if let Some(main_end) = code_str[main_start..].find("async fn main") { [INFO] [stdout] 70 | | if let Some(brace) = code_str[main_start + main_end..].find(" {") { [INFO] [stdout] 71 | | let main_signature = &code_str[main_start..main_start + main_end + brace + 2]; [INFO] [stdout] 72 | | println!(" {}", main_signature.trim()); [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 69 ~ if let Some(main_end) = code_str[main_start..].find("async fn main") [INFO] [stdout] 70 ~ && let Some(brace) = code_str[main_start + main_end..].find(" {") { [INFO] [stdout] 71 | let main_signature = &code_str[main_start..main_start + main_end + brace + 2]; [INFO] [stdout] ... [INFO] [stdout] 74 | println!(" }}"); [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/comprehensive_test.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | options.async_runtime = runtime.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: runtime.clone(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/comprehensive_test.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_original_file.rs:31:31 [INFO] [stdout] | [INFO] [stdout] 31 | .args(&["--crate-type", "lib", temp_file]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["--crate-type", "lib", temp_file]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/bin/test_error_handling.rs:1:50 [INFO] [stdout] | [INFO] [stdout] 1 | use python_ast::{parse_enhanced, SourceLocation, Error}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_final_solution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | .args(&["--crate-type", "lib", temp_file]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["--crate-type", "lib", temp_file]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/test_final_solution.rs:86:25 [INFO] [stdout] | [INFO] [stdout] 86 | / if !trimmed.is_empty() { [INFO] [stdout] 87 | | if trimmed.starts_with("use ") || [INFO] [stdout] 88 | | trimmed.starts_with("pub fn ") || [INFO] [stdout] 89 | | trimmed.starts_with("fn main") { [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if !trimmed.is_empty() [INFO] [stdout] 87 ~ && (trimmed.starts_with("use ") || [INFO] [stdout] 88 | trimmed.starts_with("pub fn ") || [INFO] [stdout] 89 ~ trimmed.starts_with("fn main")) { [INFO] [stdout] 90 | println!("{:2}: {}", i + 1, trimmed); [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/test_parse.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | match parse(&code, "test_comprehensive.py") { [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/test_detailed_output.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | options.async_runtime = AsyncRuntime::AsyncStd; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `python_ast::PythonOptions { async_runtime: AsyncRuntime::AsyncStd, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/test_detailed_output.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | let mut options = PythonOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 32.18s [INFO] running `Command { std: "docker" "inspect" "692876fc2517e7c12a77e22c991247eb5fbb5f5c89a54852815f2c0721015586", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "692876fc2517e7c12a77e22c991247eb5fbb5f5c89a54852815f2c0721015586", kill_on_drop: false }` [INFO] [stdout] 692876fc2517e7c12a77e22c991247eb5fbb5f5c89a54852815f2c0721015586