[INFO] fetching crate runar-compiler-rust 0.2.0... [INFO] linting runar-compiler-rust-0.2.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate runar-compiler-rust 0.2.0 into /workspace/builds/worker-4-tc1/source [INFO] started tweaking crates.io crate runar-compiler-rust 0.2.0 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate runar-compiler-rust 0.2.0 [INFO] tweaked toml for crates.io crate runar-compiler-rust 0.2.0 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate runar-compiler-rust 0.2.0 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 runar-compiler-rust 0.2.0 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] Downloading crates ... [INFO] [stderr] Downloaded swc_ecma_ast v0.118.2 [INFO] [stderr] Downloaded swc_ecma_parser v0.149.1 [INFO] [stderr] Downloaded swc_common v0.37.5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] f9891915e01d1a2fd73c18371d88337af29d4d342509a2e1763ef8e8c0e00121 [INFO] running `Command { std: "docker" "start" "-a" "f9891915e01d1a2fd73c18371d88337af29d4d342509a2e1763ef8e8c0e00121", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f9891915e01d1a2fd73c18371d88337af29d4d342509a2e1763ef8e8c0e00121", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f9891915e01d1a2fd73c18371d88337af29d4d342509a2e1763ef8e8c0e00121", kill_on_drop: false }` [INFO] [stdout] f9891915e01d1a2fd73c18371d88337af29d4d342509a2e1763ef8e8c0e00121 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] ca70c0caeffb2500ba527f38524236d764603f56ad7187f17cfe0dfe59713f84 [INFO] running `Command { std: "docker" "start" "-a" "ca70c0caeffb2500ba527f38524236d764603f56ad7187f17cfe0dfe59713f84", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.203 [INFO] [stderr] Compiling zerocopy v0.8.40 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Compiling serde_derive v1.0.203 [INFO] [stderr] Compiling object v0.37.3 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling swc_macros_common v0.3.14 [INFO] [stderr] Checking rustc-hash v1.1.0 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Checking bumpalo v3.20.2 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Compiling phf_macros v0.11.3 [INFO] [stderr] Checking better_scoped_tls v0.1.2 [INFO] [stderr] Compiling from_variant v0.1.9 [INFO] [stderr] Compiling ast_node v0.9.9 [INFO] [stderr] Checking swc_visit v0.6.2 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking phf v0.11.3 [INFO] [stderr] Compiling stacker v0.1.23 [INFO] [stderr] Compiling swc_eq_ignore_macros v0.1.4 [INFO] [stderr] Compiling smartstring v1.0.1 [INFO] [stderr] Compiling string_enum v0.4.4 [INFO] [stderr] Compiling is-macro v0.3.7 [INFO] [stderr] Checking unicode-id-start v1.4.0 [INFO] [stderr] Compiling serde_json v1.0.143 [INFO] [stderr] Compiling clap_derive v4.5.55 [INFO] [stderr] Checking typed-arena v2.0.2 [INFO] [stderr] Compiling ptr_meta_derive v0.1.4 [INFO] [stderr] Checking ptr_meta v0.1.4 [INFO] [stderr] Checking clap v4.5.60 [INFO] [stderr] Compiling ar_archive_writer v0.5.1 [INFO] [stderr] Compiling psm v0.1.30 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking triomphe v0.1.15 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking hstr v0.2.17 [INFO] [stderr] Checking swc_allocator v0.1.10 [INFO] [stderr] Checking swc_atoms v0.6.7 [INFO] [stderr] Checking swc_common v0.37.5 [INFO] [stderr] Checking swc_ecma_ast v0.118.2 [INFO] [stderr] Checking swc_ecma_parser v0.149.1 [INFO] [stderr] Checking runar-compiler-rust v0.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/ec.rs:171:15 [INFO] [stdout] | [INFO] [stdout] 171 | fn to_top(&mut self, name: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/ec.rs:181:15 [INFO] [stdout] | [INFO] [stdout] 181 | fn to_alt(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/codegen/ec.rs:188:17 [INFO] [stdout] | [INFO] [stdout] 188 | fn from_alt(&mut self, n: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/codegen/emit.rs:145:12 [INFO] [stdout] | [INFO] [stdout] 145 | if b >= 1 && b <= 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(1..=16).contains(&b)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/codegen/emit.rs:216:8 [INFO] [stdout] | [INFO] [stdout] 216 | if n >= 1 && n <= 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(1..=16).contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/codegen/slh_dsa.rs:210:46 [INFO] [stdout] | [INFO] [stdout] 210 | emit(StackOp::Push(PushValue::Bytes(vec![type_ & 0xff]))); [INFO] [stdout] | ^^^^^^^^^^^^ help: consider reducing it to: `type_` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/slh_dsa.rs:405:15 [INFO] [stdout] | [INFO] [stdout] 405 | fn to_top(&mut self, name: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/slh_dsa.rs:415:15 [INFO] [stdout] | [INFO] [stdout] 415 | fn to_alt(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/codegen/slh_dsa.rs:422:17 [INFO] [stdout] | [INFO] [stdout] 422 | fn from_alt(&mut self, n: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:889:47 [INFO] [stdout] | [INFO] [stdout] 889 | emit(StackOp::Push(PushValue::Int((1i128 << j) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << j))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:912:48 [INFO] [stdout] | [INFO] [stdout] 912 | e(StackOp::Push(PushValue::Int((1i128 << (j + 1)) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << (j + 1)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1094:51 [INFO] [stdout] | [INFO] [stdout] 1094 | emit(StackOp::Push(PushValue::Int((1i128 << j) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << j))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1114:52 [INFO] [stdout] | [INFO] [stdout] 1114 | e(StackOp::Push(PushValue::Int((1i128 << (j + 1)) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << (j + 1)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1204:18 [INFO] [stdout] | [INFO] [stdout] 1204 | let blocks = (out_len + 31) / 32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `out_len.div_ceil(32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1272:18 [INFO] [stdout] | [INFO] [stdout] 1272 | let md_len = (k * a + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(k * a).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1273:24 [INFO] [stdout] | [INFO] [stdout] 1273 | let tree_idx_len = (p.h - hp + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(p.h - hp).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1274:24 [INFO] [stdout] | [INFO] [stdout] 1274 | let leaf_idx_len = (hp + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.div_ceil()`: `hp.div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1474:48 [INFO] [stdout] | [INFO] [stdout] 1474 | e(StackOp::Push(PushValue::Int((1i128 << hp) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << hp))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/codegen/stack.rs:673:5 [INFO] [stdout] | [INFO] [stdout] 673 | / fn lower_bin_op( [INFO] [stdout] 674 | | &mut self, [INFO] [stdout] 675 | | binding_name: &str, [INFO] [stdout] 676 | | op: &str, [INFO] [stdout] ... | [INFO] [stdout] 681 | | result_type: Option<&str>, [INFO] [stdout] 682 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/codegen/stack.rs:920:33 [INFO] [stdout] | [INFO] [stdout] 920 | if func_name == "split" { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 921 | | self.sm.push(""); [INFO] [stdout] 922 | | self.sm.push(binding_name); [INFO] [stdout] 923 | | } else if func_name == "len" { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/codegen/stack.rs:923:38 [INFO] [stdout] | [INFO] [stdout] 923 | } else if func_name == "len" { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 924 | | self.sm.push(""); [INFO] [stdout] 925 | | self.sm.push(binding_name); [INFO] [stdout] 926 | | } 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: this function has too many arguments (8/7) [INFO] [stdout] --> src/codegen/stack.rs:995:5 [INFO] [stdout] | [INFO] [stdout] 995 | / fn lower_if( [INFO] [stdout] 996 | | &mut self, [INFO] [stdout] 997 | | binding_name: &str, [INFO] [stdout] 998 | | cond: &str, [INFO] [stdout] ... | [INFO] [stdout] 1003 | | terminal_assert: bool, [INFO] [stdout] 1004 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/codegen/stack.rs:3349:12 [INFO] [stdout] | [INFO] [stdout] 3349 | if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 3349 - if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] 3349 + if !(method.name != "constructor" && method.is_public) { [INFO] [stdout] | [INFO] [stdout] 3349 - if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] 3349 + if method.name == "constructor" || !method.is_public { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/codegen/stack.rs:3420:9 [INFO] [stdout] | [INFO] [stdout] 3420 | hex_str.len() % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `hex_str.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `add_output_refs` [INFO] [stdout] --> src/frontend/anf_lower.rs:165:30 [INFO] [stdout] | [INFO] [stdout] 165 | for i in 1..add_output_refs.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 165 - for i in 1..add_output_refs.len() { [INFO] [stdout] 165 + for in add_output_refs.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/anf_lower.rs:841:9 [INFO] [stdout] | [INFO] [stdout] 841 | / if name == "checkPreimage" { [INFO] [stdout] 842 | | if !args.is_empty() { [INFO] [stdout] 843 | | let preimage_ref = lower_expr_to_ref(&args[0], ctx); [INFO] [stdout] 844 | | return ctx.emit(ANFValue::CheckPreimage { [INFO] [stdout] ... | [INFO] [stdout] 848 | | } [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] 841 ~ if name == "checkPreimage" [INFO] [stdout] 842 ~ && !args.is_empty() { [INFO] [stdout] 843 | let preimage_ref = lower_expr_to_ref(&args[0], ctx); [INFO] [stdout] ... [INFO] [stdout] 846 | }); [INFO] [stdout] 847 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/anf_lower.rs:1224:20 [INFO] [stdout] | [INFO] [stdout] 1224 | || else_branch [INFO] [stdout] | ____________________^ [INFO] [stdout] 1225 | | .as_ref() [INFO] [stdout] 1226 | | .map_or(false, |e| body_mutates_state(e, mutable_props)) [INFO] [stdout] | |____________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1226 - .map_or(false, |e| body_mutates_state(e, mutable_props)) [INFO] [stdout] 1226 + .is_some_and(|e| body_mutates_state(e, mutable_props)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/anf_lower.rs:1274:20 [INFO] [stdout] | [INFO] [stdout] 1274 | || else_branch [INFO] [stdout] | ____________________^ [INFO] [stdout] 1275 | | .as_ref() [INFO] [stdout] 1276 | | .map_or(false, |e| body_has_add_output(e)) [INFO] [stdout] | |______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1276 - .map_or(false, |e| body_has_add_output(e)) [INFO] [stdout] 1276 + .is_some_and(|e| body_has_add_output(e)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/frontend/ast.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 43 | | match s { [INFO] [stdout] 44 | | "bigint" => Some(PrimitiveTypeName::Bigint), [INFO] [stdout] 45 | | "boolean" => Some(PrimitiveTypeName::Boolean), [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/frontend/parser.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | fn parse_type_node(ts_type: &TsType, file: &str, errors: &mut Vec) -> TypeNode { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/frontend/parser.rs:423:63 [INFO] [stdout] | [INFO] [stdout] 423 | let element = parse_type_node(¶ms[0], file, errors); [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/frontend/parser.rs:558:9 [INFO] [stdout] | [INFO] [stdout] 558 | / if let Some(ref ann) = ident.type_ann { [INFO] [stdout] 559 | | Some(parse_type_node(&ann.type_ann, file, errors)) [INFO] [stdout] 560 | | } else { [INFO] [stdout] 561 | | None [INFO] [stdout] 562 | | } [INFO] [stdout] | |_________^ help: try: `ident.type_ann.as_ref().map(|ann| parse_type_node(&ann.type_ann, file, errors))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/frontend/parser.rs:933:13 [INFO] [stdout] | [INFO] [stdout] 932 | let value = parse_expression(&assign.right, file, errors); [INFO] [stdout] | ---------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 933 | value [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] 932 ~ [INFO] [stdout] 933 ~ parse_expression(&assign.right, file, errors) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/parser_move.rs:647:9 [INFO] [stdout] | [INFO] [stdout] 647 | / if mapped == "FixedArray" || name == "FixedArray" { [INFO] [stdout] 648 | | if *self.peek() == Token::Lt { [INFO] [stdout] 649 | | self.advance(); [INFO] [stdout] 650 | | let element = self.parse_type(); [INFO] [stdout] ... | [INFO] [stdout] 666 | | } [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] 647 ~ if (mapped == "FixedArray" || name == "FixedArray") { [INFO] [stdout] 648 ~ && *self.peek() == Token::Lt { [INFO] [stdout] 649 | self.advance(); [INFO] [stdout] ... [INFO] [stdout] 664 | }; [INFO] [stdout] 665 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/frontend/parser_python.rs:262:13 [INFO] [stdout] | [INFO] [stdout] 262 | &raw_line[..raw_line.len() - 1] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/frontend/parser_python.rs:261:20 [INFO] [stdout] | [INFO] [stdout] 261 | let line = if raw_line.ends_with('\r') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_suffix` method [INFO] [stdout] | [INFO] [stdout] 261 ~ let line = if let Some() = raw_line.strip_suffix('\r') { [INFO] [stdout] 262 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/frontend/parser_python.rs:416:17 [INFO] [stdout] | [INFO] [stdout] 416 | / if paren_depth > 0 { [INFO] [stdout] 417 | | paren_depth -= 1; [INFO] [stdout] 418 | | } [INFO] [stdout] | |_________________^ help: try: `paren_depth = paren_depth.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/frontend/parser_python.rs:430:17 [INFO] [stdout] | [INFO] [stdout] 430 | / if paren_depth > 0 { [INFO] [stdout] 431 | | paren_depth -= 1; [INFO] [stdout] 432 | | } [INFO] [stdout] | |_________________^ help: try: `paren_depth = paren_depth.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/parser_python.rs:1433:12 [INFO] [stdout] | [INFO] [stdout] 1433 | if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Colon) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1433 - if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Colon) { [INFO] [stdout] 1433 + if self.tokens.get(self.pos + 1).is_some_and(|t| *t == Token::Colon) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/parser_python.rs:1457:12 [INFO] [stdout] | [INFO] [stdout] 1457 | if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Eq) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1457 - if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Eq) { [INFO] [stdout] 1457 + if self.tokens.get(self.pos + 1).is_some_and(|t| *t == Token::Eq) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:381:25 [INFO] [stdout] | [INFO] [stdout] 381 | / if let Expression::PropertyAccess { property } = target { [INFO] [stdout] 382 | | for p in properties.iter_mut() { [INFO] [stdout] 383 | | if p.name == *property { [INFO] [stdout] 384 | | p.initializer = Some(value.clone()); [INFO] [stdout] ... | [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:380:52 [INFO] [stdout] | [INFO] [stdout] 380 | if let Statement::Assignment { target, value, .. } = stmt { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 381 | if let Expression::PropertyAccess { property } = target { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `target: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/parser_sol.rs:530:9 [INFO] [stdout] | [INFO] [stdout] 530 | / if name == "FixedArray" { [INFO] [stdout] 531 | | if *self.peek() == Token::Lt { [INFO] [stdout] 532 | | self.advance(); // < [INFO] [stdout] 533 | | let element = self.parse_type(); [INFO] [stdout] ... | [INFO] [stdout] 549 | | } [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] 530 ~ if name == "FixedArray" [INFO] [stdout] 531 ~ && *self.peek() == Token::Lt { [INFO] [stdout] 532 | self.advance(); // < [INFO] [stdout] ... [INFO] [stdout] 547 | }; [INFO] [stdout] 548 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/typecheck.rs:630:17 [INFO] [stdout] | [INFO] [stdout] 630 | / if !is_subtype(&left_type, &right_type) [INFO] [stdout] 631 | | && !is_subtype(&right_type, &left_type) [INFO] [stdout] 632 | | { [INFO] [stdout] 633 | | if left_type != "" && right_type != "" { [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [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] 631 ~ && !is_subtype(&right_type, &left_type) [INFO] [stdout] 632 ~ && left_type != "" && right_type != "" { [INFO] [stdout] 633 | self.errors.push(format!( [INFO] [stdout] ... [INFO] [stdout] 638 | )); [INFO] [stdout] 639 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/frontend/typecheck.rs:932:18 [INFO] [stdout] | [INFO] [stdout] 932 | for i in count..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 932 - for i in count..args.len() { [INFO] [stdout] 932 + for in args.iter().skip(count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/frontend/typecheck.rs:1031:17 [INFO] [stdout] | [INFO] [stdout] 1031 | / if let Some(v) = value { [INFO] [stdout] 1032 | | types.push(infer_expr_type_static(v)); [INFO] [stdout] 1033 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/typecheck.rs:1030:42 [INFO] [stdout] | [INFO] [stdout] 1030 | Statement::ReturnStatement { value, .. } => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1031 | if let Some(v) = value { [INFO] [stdout] | ^^^^^^^ with this pattern, prefixed by `value: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/validator.rs:109:13 [INFO] [stdout] | [INFO] [stdout] 109 | / if let Expression::PropertyAccess { property } = target { [INFO] [stdout] 110 | | assigned_props.insert(property.clone()); [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/validator.rs:108:40 [INFO] [stdout] | [INFO] [stdout] 108 | if let Statement::Assignment { target, .. } = stmt { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 109 | if let Expression::PropertyAccess { property } = target { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `target: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/validator.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | / if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] 153 | | if let Expression::Identifier { name } = callee.as_ref() { [INFO] [stdout] 154 | | return name == "super"; [INFO] [stdout] 155 | | } [INFO] [stdout] 156 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/validator.rs:151:45 [INFO] [stdout] | [INFO] [stdout] 151 | if let Statement::ExpressionStatement { expression, .. } = stmt { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 152 | if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/validator.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 186 | / if method.visibility == Visibility::Public && contract.parent_class == "SmartContract" { [INFO] [stdout] 187 | | if !ends_with_assert(&method.body) { [INFO] [stdout] 188 | | errors.push(format!( [INFO] [stdout] 189 | | "Public method '{}' must end with an assert() call", [INFO] [stdout] ... | [INFO] [stdout] 193 | | } [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] 186 ~ if method.visibility == Visibility::Public && contract.parent_class == "SmartContract" [INFO] [stdout] 187 ~ && !ends_with_assert(&method.body) { [INFO] [stdout] 188 | errors.push(format!( [INFO] [stdout] ... [INFO] [stdout] 191 | )); [INFO] [stdout] 192 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/validator.rs:223:25 [INFO] [stdout] | [INFO] [stdout] 223 | let else_ends = else_branch [INFO] [stdout] | _________________________^ [INFO] [stdout] 224 | | .as_ref() [INFO] [stdout] 225 | | .map_or(false, |e| ends_with_assert(e)); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 225 - .map_or(false, |e| ends_with_assert(e)); [INFO] [stdout] 225 + .is_some_and(|e| ends_with_assert(e)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/frontend/validator.rs:325:43 [INFO] [stdout] | [INFO] [stdout] 325 | fn validate_expression(expr: &Expression, errors: &mut Vec) { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_errors` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/frontend/validator.rs:328:39 [INFO] [stdout] | [INFO] [stdout] 328 | validate_expression(left, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 329 | validate_expression(right, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 332 | validate_expression(operand, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 335 | validate_expression(callee, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 336 | for arg in args { [INFO] [stdout] 337 | validate_expression(arg, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 341 | validate_expression(object, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 348 | validate_expression(condition, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 349 | validate_expression(consequent, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 350 | validate_expression(alternate, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 353 | validate_expression(object, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 354 | validate_expression(index, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 357 | validate_expression(operand, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/validator.rs:525:13 [INFO] [stdout] | [INFO] [stdout] 525 | / if method_names.contains(callee) { [INFO] [stdout] 526 | | if has_cycle(callee, call_graph, method_names, visited, stack) { [INFO] [stdout] 527 | | return true; [INFO] [stdout] 528 | | } [INFO] [stdout] 529 | | } [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] 525 ~ if method_names.contains(callee) [INFO] [stdout] 526 ~ && has_cycle(callee, call_graph, method_names, visited, stack) { [INFO] [stdout] 527 | return true; [INFO] [stdout] 528 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/ir/mod.rs:179:20 [INFO] [stdout] | [INFO] [stdout] 179 | } else if let Some(f) = n.as_f64() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 180 | | Some(ConstValue::Int(f as i128)) [INFO] [stdout] 181 | | } else { [INFO] [stdout] 182 | | None [INFO] [stdout] 183 | | } [INFO] [stdout] | |_____________^ help: try: `{ n.as_f64().map(|f| ConstValue::Int(f as i128)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `runar_compiler_rust::frontend::ast::Visibility` [INFO] [stdout] --> tests/multiformat_tests.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | use runar_compiler_rust::frontend::ast::Visibility; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result.contract` after checking its variant with `is_some` [INFO] [stdout] --> tests/multiformat_tests.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 47 | if result.contract.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &result.contract` [INFO] [stdout] 48 | assert_eq!(result.contract.as_ref().unwrap().name, "Arithmetic"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result.contract` after checking its variant with `is_some` [INFO] [stdout] --> tests/multiformat_tests.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 57 | if result.contract.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &result.contract` [INFO] [stdout] 58 | assert_eq!(result.contract.as_ref().unwrap().name, "Arithmetic"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/ec.rs:171:15 [INFO] [stdout] | [INFO] [stdout] 171 | fn to_top(&mut self, name: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/ec.rs:181:15 [INFO] [stdout] | [INFO] [stdout] 181 | fn to_alt(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/codegen/ec.rs:188:17 [INFO] [stdout] | [INFO] [stdout] 188 | fn from_alt(&mut self, n: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/codegen/emit.rs:145:12 [INFO] [stdout] | [INFO] [stdout] 145 | if b >= 1 && b <= 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(1..=16).contains(&b)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/codegen/emit.rs:216:8 [INFO] [stdout] | [INFO] [stdout] 216 | if n >= 1 && n <= 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(1..=16).contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/codegen/slh_dsa.rs:210:46 [INFO] [stdout] | [INFO] [stdout] 210 | emit(StackOp::Push(PushValue::Bytes(vec![type_ & 0xff]))); [INFO] [stdout] | ^^^^^^^^^^^^ help: consider reducing it to: `type_` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/slh_dsa.rs:405:15 [INFO] [stdout] | [INFO] [stdout] 405 | fn to_top(&mut self, name: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/codegen/slh_dsa.rs:415:15 [INFO] [stdout] | [INFO] [stdout] 415 | fn to_alt(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/codegen/slh_dsa.rs:422:17 [INFO] [stdout] | [INFO] [stdout] 422 | fn from_alt(&mut self, n: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:889:47 [INFO] [stdout] | [INFO] [stdout] 889 | emit(StackOp::Push(PushValue::Int((1i128 << j) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << j))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:912:48 [INFO] [stdout] | [INFO] [stdout] 912 | e(StackOp::Push(PushValue::Int((1i128 << (j + 1)) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << (j + 1)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1094:51 [INFO] [stdout] | [INFO] [stdout] 1094 | emit(StackOp::Push(PushValue::Int((1i128 << j) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << j))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1114:52 [INFO] [stdout] | [INFO] [stdout] 1114 | e(StackOp::Push(PushValue::Int((1i128 << (j + 1)) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << (j + 1)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1204:18 [INFO] [stdout] | [INFO] [stdout] 1204 | let blocks = (out_len + 31) / 32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `out_len.div_ceil(32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1272:18 [INFO] [stdout] | [INFO] [stdout] 1272 | let md_len = (k * a + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(k * a).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1273:24 [INFO] [stdout] | [INFO] [stdout] 1273 | let tree_idx_len = (p.h - hp + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(p.h - hp).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/codegen/slh_dsa.rs:1274:24 [INFO] [stdout] | [INFO] [stdout] 1274 | let leaf_idx_len = (hp + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.div_ceil()`: `hp.div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i128` -> `i128`) [INFO] [stdout] --> src/codegen/slh_dsa.rs:1474:48 [INFO] [stdout] | [INFO] [stdout] 1474 | e(StackOp::Push(PushValue::Int((1i128 << hp) as i128))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((1i128 << hp))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/codegen/stack.rs:673:5 [INFO] [stdout] | [INFO] [stdout] 673 | / fn lower_bin_op( [INFO] [stdout] 674 | | &mut self, [INFO] [stdout] 675 | | binding_name: &str, [INFO] [stdout] 676 | | op: &str, [INFO] [stdout] ... | [INFO] [stdout] 681 | | result_type: Option<&str>, [INFO] [stdout] 682 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/codegen/stack.rs:920:33 [INFO] [stdout] | [INFO] [stdout] 920 | if func_name == "split" { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 921 | | self.sm.push(""); [INFO] [stdout] 922 | | self.sm.push(binding_name); [INFO] [stdout] 923 | | } else if func_name == "len" { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/codegen/stack.rs:923:38 [INFO] [stdout] | [INFO] [stdout] 923 | } else if func_name == "len" { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 924 | | self.sm.push(""); [INFO] [stdout] 925 | | self.sm.push(binding_name); [INFO] [stdout] 926 | | } 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: this function has too many arguments (8/7) [INFO] [stdout] --> src/codegen/stack.rs:995:5 [INFO] [stdout] | [INFO] [stdout] 995 | / fn lower_if( [INFO] [stdout] 996 | | &mut self, [INFO] [stdout] 997 | | binding_name: &str, [INFO] [stdout] 998 | | cond: &str, [INFO] [stdout] ... | [INFO] [stdout] 1003 | | terminal_assert: bool, [INFO] [stdout] 1004 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/codegen/stack.rs:3349:12 [INFO] [stdout] | [INFO] [stdout] 3349 | if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 3349 - if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] 3349 + if !(method.name != "constructor" && method.is_public) { [INFO] [stdout] | [INFO] [stdout] 3349 - if method.name == "constructor" || (!method.is_public && method.name != "constructor") { [INFO] [stdout] 3349 + if method.name == "constructor" || !method.is_public { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/codegen/stack.rs:3420:9 [INFO] [stdout] | [INFO] [stdout] 3420 | hex_str.len() % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `hex_str.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `add_output_refs` [INFO] [stdout] --> src/frontend/anf_lower.rs:165:30 [INFO] [stdout] | [INFO] [stdout] 165 | for i in 1..add_output_refs.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 165 - for i in 1..add_output_refs.len() { [INFO] [stdout] 165 + for in add_output_refs.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/anf_lower.rs:841:9 [INFO] [stdout] | [INFO] [stdout] 841 | / if name == "checkPreimage" { [INFO] [stdout] 842 | | if !args.is_empty() { [INFO] [stdout] 843 | | let preimage_ref = lower_expr_to_ref(&args[0], ctx); [INFO] [stdout] 844 | | return ctx.emit(ANFValue::CheckPreimage { [INFO] [stdout] ... | [INFO] [stdout] 848 | | } [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] 841 ~ if name == "checkPreimage" [INFO] [stdout] 842 ~ && !args.is_empty() { [INFO] [stdout] 843 | let preimage_ref = lower_expr_to_ref(&args[0], ctx); [INFO] [stdout] ... [INFO] [stdout] 846 | }); [INFO] [stdout] 847 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/anf_lower.rs:1224:20 [INFO] [stdout] | [INFO] [stdout] 1224 | || else_branch [INFO] [stdout] | ____________________^ [INFO] [stdout] 1225 | | .as_ref() [INFO] [stdout] 1226 | | .map_or(false, |e| body_mutates_state(e, mutable_props)) [INFO] [stdout] | |____________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1226 - .map_or(false, |e| body_mutates_state(e, mutable_props)) [INFO] [stdout] 1226 + .is_some_and(|e| body_mutates_state(e, mutable_props)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/anf_lower.rs:1274:20 [INFO] [stdout] | [INFO] [stdout] 1274 | || else_branch [INFO] [stdout] | ____________________^ [INFO] [stdout] 1275 | | .as_ref() [INFO] [stdout] 1276 | | .map_or(false, |e| body_has_add_output(e)) [INFO] [stdout] | |______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1276 - .map_or(false, |e| body_has_add_output(e)) [INFO] [stdout] 1276 + .is_some_and(|e| body_has_add_output(e)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/frontend/ast.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 43 | | match s { [INFO] [stdout] 44 | | "bigint" => Some(PrimitiveTypeName::Bigint), [INFO] [stdout] 45 | | "boolean" => Some(PrimitiveTypeName::Boolean), [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/frontend/parser.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | fn parse_type_node(ts_type: &TsType, file: &str, errors: &mut Vec) -> TypeNode { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/frontend/parser.rs:423:63 [INFO] [stdout] | [INFO] [stdout] 423 | let element = parse_type_node(¶ms[0], file, errors); [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/frontend/parser.rs:558:9 [INFO] [stdout] | [INFO] [stdout] 558 | / if let Some(ref ann) = ident.type_ann { [INFO] [stdout] 559 | | Some(parse_type_node(&ann.type_ann, file, errors)) [INFO] [stdout] 560 | | } else { [INFO] [stdout] 561 | | None [INFO] [stdout] 562 | | } [INFO] [stdout] | |_________^ help: try: `ident.type_ann.as_ref().map(|ann| parse_type_node(&ann.type_ann, file, errors))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/frontend/parser.rs:933:13 [INFO] [stdout] | [INFO] [stdout] 932 | let value = parse_expression(&assign.right, file, errors); [INFO] [stdout] | ---------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 933 | value [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] 932 ~ [INFO] [stdout] 933 ~ parse_expression(&assign.right, file, errors) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/parser_move.rs:647:9 [INFO] [stdout] | [INFO] [stdout] 647 | / if mapped == "FixedArray" || name == "FixedArray" { [INFO] [stdout] 648 | | if *self.peek() == Token::Lt { [INFO] [stdout] 649 | | self.advance(); [INFO] [stdout] 650 | | let element = self.parse_type(); [INFO] [stdout] ... | [INFO] [stdout] 666 | | } [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] 647 ~ if (mapped == "FixedArray" || name == "FixedArray") { [INFO] [stdout] 648 ~ && *self.peek() == Token::Lt { [INFO] [stdout] 649 | self.advance(); [INFO] [stdout] ... [INFO] [stdout] 664 | }; [INFO] [stdout] 665 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_move.rs:1624:13 [INFO] [stdout] | [INFO] [stdout] 1624 | / if let Expression::CallExpr { callee, args } = expression { [INFO] [stdout] 1625 | | if let Expression::Identifier { name } = callee.as_ref() { [INFO] [stdout] 1626 | | assert_eq!(name, "assert"); [INFO] [stdout] ... | [INFO] [stdout] 1633 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_move.rs:1623:49 [INFO] [stdout] | [INFO] [stdout] 1623 | if let Statement::ExpressionStatement { expression, .. } = &body[0] { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 1624 | if let Expression::CallExpr { callee, args } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/frontend/parser_python.rs:262:13 [INFO] [stdout] | [INFO] [stdout] 262 | &raw_line[..raw_line.len() - 1] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/frontend/parser_python.rs:261:20 [INFO] [stdout] | [INFO] [stdout] 261 | let line = if raw_line.ends_with('\r') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_suffix` method [INFO] [stdout] | [INFO] [stdout] 261 ~ let line = if let Some() = raw_line.strip_suffix('\r') { [INFO] [stdout] 262 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/frontend/parser_python.rs:416:17 [INFO] [stdout] | [INFO] [stdout] 416 | / if paren_depth > 0 { [INFO] [stdout] 417 | | paren_depth -= 1; [INFO] [stdout] 418 | | } [INFO] [stdout] | |_________________^ help: try: `paren_depth = paren_depth.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/frontend/parser_python.rs:430:17 [INFO] [stdout] | [INFO] [stdout] 430 | / if paren_depth > 0 { [INFO] [stdout] 431 | | paren_depth -= 1; [INFO] [stdout] 432 | | } [INFO] [stdout] | |_________________^ help: try: `paren_depth = paren_depth.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/parser_python.rs:1433:12 [INFO] [stdout] | [INFO] [stdout] 1433 | if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Colon) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1433 - if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Colon) { [INFO] [stdout] 1433 + if self.tokens.get(self.pos + 1).is_some_and(|t| *t == Token::Colon) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/parser_python.rs:1457:12 [INFO] [stdout] | [INFO] [stdout] 1457 | if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Eq) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 1457 - if self.tokens.get(self.pos + 1).map_or(false, |t| *t == Token::Eq) { [INFO] [stdout] 1457 + if self.tokens.get(self.pos + 1).is_some_and(|t| *t == Token::Eq) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_python.rs:2294:13 [INFO] [stdout] | [INFO] [stdout] 2294 | / if let Expression::CallExpr { args, .. } = expression { [INFO] [stdout] 2295 | | if let Expression::BinaryExpr { op, .. } = &args[0] { [INFO] [stdout] 2296 | | assert_eq!(*op, BinaryOp::StrictNe); [INFO] [stdout] 2297 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 2300 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_python.rs:2293:49 [INFO] [stdout] | [INFO] [stdout] 2293 | if let Statement::ExpressionStatement { expression, .. } = &body[1] { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 2294 | if let Expression::CallExpr { args, .. } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_python.rs:2437:13 [INFO] [stdout] | [INFO] [stdout] 2437 | / if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] 2438 | | if let Expression::Identifier { name } = callee.as_ref() { [INFO] [stdout] 2439 | | assert_eq!(name, "assert"); [INFO] [stdout] 2440 | | } [INFO] [stdout] 2441 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_python.rs:2436:49 [INFO] [stdout] | [INFO] [stdout] 2436 | if let Statement::ExpressionStatement { expression, .. } = &body[0] { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 2437 | if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_python.rs:2495:13 [INFO] [stdout] | [INFO] [stdout] 2495 | / if let Expression::BinaryExpr { op, .. } = init { [INFO] [stdout] 2496 | | assert_eq!(*op, BinaryOp::Shl); [INFO] [stdout] 2497 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_python.rs:2494:42 [INFO] [stdout] | [INFO] [stdout] 2494 | if let Statement::VariableDecl { init, .. } = &body[0] { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 2495 | if let Expression::BinaryExpr { op, .. } = init { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `init: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_python.rs:2501:13 [INFO] [stdout] | [INFO] [stdout] 2501 | / if let Expression::BinaryExpr { op, .. } = init { [INFO] [stdout] 2502 | | assert_eq!(*op, BinaryOp::Shr); [INFO] [stdout] 2503 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_python.rs:2500:42 [INFO] [stdout] | [INFO] [stdout] 2500 | if let Statement::VariableDecl { init, .. } = &body[1] { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 2501 | if let Expression::BinaryExpr { op, .. } = init { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `init: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:381:25 [INFO] [stdout] | [INFO] [stdout] 381 | / if let Expression::PropertyAccess { property } = target { [INFO] [stdout] 382 | | for p in properties.iter_mut() { [INFO] [stdout] 383 | | if p.name == *property { [INFO] [stdout] 384 | | p.initializer = Some(value.clone()); [INFO] [stdout] ... | [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:380:52 [INFO] [stdout] | [INFO] [stdout] 380 | if let Statement::Assignment { target, value, .. } = stmt { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 381 | if let Expression::PropertyAccess { property } = target { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `target: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:1259:13 [INFO] [stdout] | [INFO] [stdout] 1259 | / if let Expression::CallExpr { callee, args } = expression { [INFO] [stdout] 1260 | | if let Expression::Identifier { name } = callee.as_ref() { [INFO] [stdout] 1261 | | assert_eq!(name, "assert"); [INFO] [stdout] ... | [INFO] [stdout] 1268 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/parser_rustmacro.rs:1258:49 [INFO] [stdout] | [INFO] [stdout] 1258 | if let Statement::ExpressionStatement { expression, .. } = &body[0] { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 1259 | if let Expression::CallExpr { callee, args } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/parser_sol.rs:530:9 [INFO] [stdout] | [INFO] [stdout] 530 | / if name == "FixedArray" { [INFO] [stdout] 531 | | if *self.peek() == Token::Lt { [INFO] [stdout] 532 | | self.advance(); // < [INFO] [stdout] 533 | | let element = self.parse_type(); [INFO] [stdout] ... | [INFO] [stdout] 549 | | } [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] 530 ~ if name == "FixedArray" [INFO] [stdout] 531 ~ && *self.peek() == Token::Lt { [INFO] [stdout] 532 | self.advance(); // < [INFO] [stdout] ... [INFO] [stdout] 547 | }; [INFO] [stdout] 548 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/typecheck.rs:630:17 [INFO] [stdout] | [INFO] [stdout] 630 | / if !is_subtype(&left_type, &right_type) [INFO] [stdout] 631 | | && !is_subtype(&right_type, &left_type) [INFO] [stdout] 632 | | { [INFO] [stdout] 633 | | if left_type != "" && right_type != "" { [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [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] 631 ~ && !is_subtype(&right_type, &left_type) [INFO] [stdout] 632 ~ && left_type != "" && right_type != "" { [INFO] [stdout] 633 | self.errors.push(format!( [INFO] [stdout] ... [INFO] [stdout] 638 | )); [INFO] [stdout] 639 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/frontend/typecheck.rs:932:18 [INFO] [stdout] | [INFO] [stdout] 932 | for i in count..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 932 - for i in count..args.len() { [INFO] [stdout] 932 + for in args.iter().skip(count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/frontend/typecheck.rs:1031:17 [INFO] [stdout] | [INFO] [stdout] 1031 | / if let Some(v) = value { [INFO] [stdout] 1032 | | types.push(infer_expr_type_static(v)); [INFO] [stdout] 1033 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/typecheck.rs:1030:42 [INFO] [stdout] | [INFO] [stdout] 1030 | Statement::ReturnStatement { value, .. } => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1031 | if let Some(v) = value { [INFO] [stdout] | ^^^^^^^ with this pattern, prefixed by `value: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/validator.rs:109:13 [INFO] [stdout] | [INFO] [stdout] 109 | / if let Expression::PropertyAccess { property } = target { [INFO] [stdout] 110 | | assigned_props.insert(property.clone()); [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/validator.rs:108:40 [INFO] [stdout] | [INFO] [stdout] 108 | if let Statement::Assignment { target, .. } = stmt { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 109 | if let Expression::PropertyAccess { property } = target { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `target: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/frontend/validator.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | / if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] 153 | | if let Expression::Identifier { name } = callee.as_ref() { [INFO] [stdout] 154 | | return name == "super"; [INFO] [stdout] 155 | | } [INFO] [stdout] 156 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/frontend/validator.rs:151:45 [INFO] [stdout] | [INFO] [stdout] 151 | if let Statement::ExpressionStatement { expression, .. } = stmt { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 152 | if let Expression::CallExpr { callee, .. } = expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `expression: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/validator.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 186 | / if method.visibility == Visibility::Public && contract.parent_class == "SmartContract" { [INFO] [stdout] 187 | | if !ends_with_assert(&method.body) { [INFO] [stdout] 188 | | errors.push(format!( [INFO] [stdout] 189 | | "Public method '{}' must end with an assert() call", [INFO] [stdout] ... | [INFO] [stdout] 193 | | } [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] 186 ~ if method.visibility == Visibility::Public && contract.parent_class == "SmartContract" [INFO] [stdout] 187 ~ && !ends_with_assert(&method.body) { [INFO] [stdout] 188 | errors.push(format!( [INFO] [stdout] ... [INFO] [stdout] 191 | )); [INFO] [stdout] 192 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/frontend/validator.rs:223:25 [INFO] [stdout] | [INFO] [stdout] 223 | let else_ends = else_branch [INFO] [stdout] | _________________________^ [INFO] [stdout] 224 | | .as_ref() [INFO] [stdout] 225 | | .map_or(false, |e| ends_with_assert(e)); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 225 - .map_or(false, |e| ends_with_assert(e)); [INFO] [stdout] 225 + .is_some_and(|e| ends_with_assert(e)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/frontend/validator.rs:325:43 [INFO] [stdout] | [INFO] [stdout] 325 | fn validate_expression(expr: &Expression, errors: &mut Vec) { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_errors` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/frontend/validator.rs:328:39 [INFO] [stdout] | [INFO] [stdout] 328 | validate_expression(left, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 329 | validate_expression(right, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 332 | validate_expression(operand, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 335 | validate_expression(callee, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 336 | for arg in args { [INFO] [stdout] 337 | validate_expression(arg, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 341 | validate_expression(object, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 348 | validate_expression(condition, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 349 | validate_expression(consequent, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 350 | validate_expression(alternate, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 353 | validate_expression(object, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 354 | validate_expression(index, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 357 | validate_expression(operand, errors); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/frontend/validator.rs:525:13 [INFO] [stdout] | [INFO] [stdout] 525 | / if method_names.contains(callee) { [INFO] [stdout] 526 | | if has_cycle(callee, call_graph, method_names, visited, stack) { [INFO] [stdout] 527 | | return true; [INFO] [stdout] 528 | | } [INFO] [stdout] 529 | | } [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] 525 ~ if method_names.contains(callee) [INFO] [stdout] 526 ~ && has_cycle(callee, call_graph, method_names, visited, stack) { [INFO] [stdout] 527 | return true; [INFO] [stdout] 528 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/ir/mod.rs:179:20 [INFO] [stdout] | [INFO] [stdout] 179 | } else if let Some(f) = n.as_f64() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 180 | | Some(ConstValue::Int(f as i128)) [INFO] [stdout] 181 | | } else { [INFO] [stdout] 182 | | None [INFO] [stdout] 183 | | } [INFO] [stdout] | |_____________^ help: try: `{ n.as_f64().map(|f| ConstValue::Int(f as i128)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 44.14s [INFO] running `Command { std: "docker" "inspect" "ca70c0caeffb2500ba527f38524236d764603f56ad7187f17cfe0dfe59713f84", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ca70c0caeffb2500ba527f38524236d764603f56ad7187f17cfe0dfe59713f84", kill_on_drop: false }` [INFO] [stdout] ca70c0caeffb2500ba527f38524236d764603f56ad7187f17cfe0dfe59713f84