[INFO] cloning repository https://github.com/jrmuizel/wasm-lang1 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jrmuizel/wasm-lang1" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrmuizel%2Fwasm-lang1", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrmuizel%2Fwasm-lang1'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] fd51142c5dc715fa8a430dc16fe8fc14f8738c5d [INFO] linting jrmuizel/wasm-lang1 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrmuizel%2Fwasm-lang1" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/jrmuizel/wasm-lang1 [INFO] finished tweaking git repo https://github.com/jrmuizel/wasm-lang1 [INFO] tweaked toml for git repo https://github.com/jrmuizel/wasm-lang1 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jrmuizel/wasm-lang1 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 git repo https://github.com/jrmuizel/wasm-lang1 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] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wat v1.233.0 [INFO] [stderr] Downloaded wasmtime-winch v33.0.0 [INFO] [stderr] Downloaded wasmtime-component-util v33.0.0 [INFO] [stderr] Downloaded ittapi v0.4.0 [INFO] [stderr] Downloaded sptr v0.3.2 [INFO] [stderr] Downloaded cranelift-native v0.120.0 [INFO] [stderr] Downloaded trait-variant v0.1.2 [INFO] [stderr] Downloaded psm v0.1.26 [INFO] [stderr] Downloaded fxprof-processed-profile v0.6.0 [INFO] [stderr] Downloaded wasmtime-fiber v33.0.0 [INFO] [stderr] Downloaded cranelift-assembler-x64-meta v0.120.0 [INFO] [stderr] Downloaded memfd v0.6.4 [INFO] [stderr] Downloaded pulley-interpreter v33.0.0 [INFO] [stderr] Downloaded toml v0.8.22 [INFO] [stderr] Downloaded cranelift-codegen-meta v0.120.0 [INFO] [stderr] Downloaded wast v233.0.0 [INFO] [stderr] Downloaded ittapi-sys v0.4.0 [INFO] [stderr] Downloaded wit-parser v0.229.0 [INFO] [stderr] Downloaded regalloc2 v0.12.2 [INFO] [stderr] Downloaded wasmtime-environ v33.0.0 [INFO] [stderr] Downloaded wasmtime-cranelift v33.0.0 [INFO] [stderr] Downloaded wasmparser v0.229.0 [INFO] [stderr] Downloaded wasmparser v0.233.0 [INFO] [stderr] Downloaded cc v1.2.25 [INFO] [stderr] Downloaded wasmtime-component-macro v33.0.0 [INFO] [stderr] Downloaded cranelift-frontend v0.120.0 [INFO] [stderr] Downloaded cranelift-isle v0.120.0 [INFO] [stderr] Downloaded cpp_demangle v0.4.4 [INFO] [stderr] Downloaded wasm-encoder v0.229.0 [INFO] [stderr] Downloaded winch-codegen v33.0.0 [INFO] [stderr] Downloaded wasmprinter v0.229.0 [INFO] [stderr] Downloaded wasm-encoder v0.233.0 [INFO] [stderr] Downloaded wasmtime-cache v33.0.0 [INFO] [stderr] Downloaded wasmtime-wit-bindgen v33.0.0 [INFO] [stderr] Downloaded postcard v1.1.1 [INFO] [stderr] Downloaded arbitrary v1.4.1 [INFO] [stderr] Downloaded cranelift-assembler-x64 v0.120.0 [INFO] [stderr] Downloaded cranelift-bforest v0.120.0 [INFO] [stderr] Downloaded wasmtime-versioned-export-macros v33.0.0 [INFO] [stderr] Downloaded cranelift-entity v0.120.0 [INFO] [stderr] Downloaded cobs v0.2.3 [INFO] [stderr] Downloaded toml_write v0.1.1 [INFO] [stderr] Downloaded wasmtime-jit-debug v33.0.0 [INFO] [stderr] Downloaded wasmtime-jit-icache-coherence v33.0.0 [INFO] [stderr] Downloaded cranelift-srcgen v0.120.0 [INFO] [stderr] Downloaded cranelift-control v0.120.0 [INFO] [stderr] Downloaded wasmtime-math v33.0.0 [INFO] [stderr] Downloaded id-arena v2.2.1 [INFO] [stderr] Downloaded wasmtime-asm-macros v33.0.0 [INFO] [stderr] Downloaded wasmtime-slab v33.0.0 [INFO] [stderr] Downloaded cranelift-bitset v0.120.0 [INFO] [stderr] Downloaded cranelift-codegen-shared v0.120.0 [INFO] [stderr] Downloaded cranelift-codegen v0.120.0 [INFO] [stderr] Downloaded wasmtime v33.0.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 36eeeaf4d78d84cf25abd636381e8b28a2f9ad671b1516f112921265cc22cf17 [INFO] running `Command { std: "docker" "start" "-a" "36eeeaf4d78d84cf25abd636381e8b28a2f9ad671b1516f112921265cc22cf17", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "36eeeaf4d78d84cf25abd636381e8b28a2f9ad671b1516f112921265cc22cf17", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "36eeeaf4d78d84cf25abd636381e8b28a2f9ad671b1516f112921265cc22cf17", kill_on_drop: false }` [INFO] [stdout] 36eeeaf4d78d84cf25abd636381e8b28a2f9ad671b1516f112921265cc22cf17 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 28f913fba4d3805cc652f82493b095c4c0cb24e1ffdf8898598379e29ed692b1 [INFO] running `Command { std: "docker" "start" "-a" "28f913fba4d3805cc652f82493b095c4c0cb24e1ffdf8898598379e29ed692b1", kill_on_drop: false }` [INFO] [stderr] Compiling anyhow v1.0.98 [INFO] [stderr] Compiling log v0.4.27 [INFO] [stderr] Compiling cranelift-srcgen v0.120.0 [INFO] [stderr] Checking bitflags v2.9.1 [INFO] [stderr] Checking fallible-iterator v0.3.0 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Compiling cranelift-isle v0.120.0 [INFO] [stderr] Compiling cranelift-bitset v0.120.0 [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Checking bumpalo v3.17.0 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling cranelift-codegen-shared v0.120.0 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling target-lexicon v0.13.2 [INFO] [stderr] Compiling semver v1.0.26 [INFO] [stderr] Checking leb128fmt v0.1.0 [INFO] [stderr] Checking wasmtime-math v33.0.0 [INFO] [stderr] Compiling wasmparser v0.229.0 [INFO] [stderr] Compiling cranelift-assembler-x64-meta v0.120.0 [INFO] [stderr] Compiling pulley-interpreter v33.0.0 [INFO] [stderr] Compiling rustix v1.0.7 [INFO] [stderr] Compiling object v0.36.7 [INFO] [stderr] Checking arbitrary v1.4.1 [INFO] [stderr] Checking crc32fast v1.4.2 [INFO] [stderr] Checking linux-raw-sys v0.9.4 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Compiling itoa v1.0.15 [INFO] [stderr] Compiling ryu v1.0.20 [INFO] [stderr] Checking cobs v0.2.3 [INFO] [stderr] Compiling wasm-encoder v0.233.0 [INFO] [stderr] Compiling cpp_demangle v0.4.4 [INFO] [stderr] Compiling jobserver v0.1.33 [INFO] [stderr] Compiling wasm-encoder v0.229.0 [INFO] [stderr] Compiling memchr v2.7.4 [INFO] [stderr] Checking toml_write v0.1.1 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Compiling cranelift-assembler-x64 v0.120.0 [INFO] [stderr] Compiling id-arena v2.2.1 [INFO] [stderr] Compiling cc v1.2.25 [INFO] [stderr] Checking winnow v0.7.10 [INFO] [stderr] Checking cranelift-control v0.120.0 [INFO] [stderr] Compiling rayon-core v1.12.1 [INFO] [stderr] Compiling rustix v0.38.44 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Checking wasmtime-component-util v33.0.0 [INFO] [stderr] Checking rustc-demangle v0.1.24 [INFO] [stderr] Checking uuid v1.17.0 [INFO] [stderr] Compiling wasmtime-cache v33.0.0 [INFO] [stderr] Compiling wasmtime-component-macro v33.0.0 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking directories-next v2.0.0 [INFO] [stderr] Checking debugid v0.8.0 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Checking wasmtime-asm-macros v33.0.0 [INFO] [stderr] Checking wasmtime-jit-icache-coherence v33.0.0 [INFO] [stderr] Checking sptr v0.3.2 [INFO] [stderr] Checking wasmtime-slab v33.0.0 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Compiling zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Compiling ittapi-sys v0.4.0 [INFO] [stderr] Compiling cranelift-codegen-meta v0.120.0 [INFO] [stderr] Checking memfd v0.6.4 [INFO] [stderr] Checking ittapi v0.4.0 [INFO] [stderr] Compiling indexmap v2.9.0 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Compiling cranelift-codegen v0.120.0 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling wasmtime-versioned-export-macros v33.0.0 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Compiling trait-variant v0.1.2 [INFO] [stderr] Compiling wasmtime-fiber v33.0.0 [INFO] [stderr] Compiling wasmtime-jit-debug v33.0.0 [INFO] [stderr] Compiling wasmtime v33.0.0 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Compiling wit-parser v0.229.0 [INFO] [stderr] Checking smallvec v1.15.0 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking toml_datetime v0.6.9 [INFO] [stderr] Checking postcard v1.1.1 [INFO] [stderr] Checking cranelift-entity v0.120.0 [INFO] [stderr] Checking regalloc2 v0.12.2 [INFO] [stderr] Checking cranelift-bforest v0.120.0 [INFO] [stderr] Checking fxprof-processed-profile v0.6.0 [INFO] [stderr] Checking gimli v0.31.1 [INFO] [stderr] Checking toml_edit v0.22.26 [INFO] [stderr] Compiling wasmtime-wit-bindgen v33.0.0 [INFO] [stderr] Checking toml v0.8.22 [INFO] [stderr] Checking wast v233.0.0 [INFO] [stderr] Checking addr2line v0.24.2 [INFO] [stderr] Checking wasmprinter v0.229.0 [INFO] [stderr] Checking wasmtime-environ v33.0.0 [INFO] [stderr] Checking wat v1.233.0 [INFO] [stderr] Checking cranelift-native v0.120.0 [INFO] [stderr] Checking cranelift-frontend v0.120.0 [INFO] [stderr] Checking wasmtime-cranelift v33.0.0 [INFO] [stderr] Checking lang1 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `Token` [INFO] [stdout] --> src/codegen.rs:3:33 [INFO] [stdout] | [INFO] [stdout] 3 | use crate::parser::{Stmt, Expr, Token}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/codegen.rs:4:33 [INFO] [stdout] | [INFO] [stdout] 4 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Token` [INFO] [stdout] --> src/codegen.rs:3:33 [INFO] [stdout] | [INFO] [stdout] 3 | use crate::parser::{Stmt, Expr, Token}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/codegen.rs:4:33 [INFO] [stdout] | [INFO] [stdout] 4 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `next` [INFO] [stdout] --> src/parser.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | let next = clone.next(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_next` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `is_main` [INFO] [stdout] --> src/codegen.rs:183:9 [INFO] [stdout] | [INFO] [stdout] 183 | is_main: bool, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_is_main` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/codegen.rs:727:13 [INFO] [stdout] | [INFO] [stdout] 727 | _ => "".to_string(), [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/codegen.rs:727:13 [INFO] [stdout] | [INFO] [stdout] 472 | Expr::LiteralInt(n) => format!("i32.const {}", n), [INFO] [stdout] | ------------------- matches some of the same values [INFO] [stdout] 473 | Expr::LiteralBool(b) => format!("i32.const {}", if *b { 1 } else { 0 }), [INFO] [stdout] | -------------------- matches some of the same values [INFO] [stdout] 474 | Expr::LiteralString(s) => { [INFO] [stdout] | ---------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 484 | Expr::LiteralNull => "ref.null $String".to_string(), [INFO] [stdout] | ----------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 727 | _ => "".to_string(), [INFO] [stdout] | ^ ...and 9 other patterns collectively make this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `wasm_elem_type` [INFO] [stdout] --> src/codegen.rs:775:17 [INFO] [stdout] | [INFO] [stdout] 775 | let wasm_elem_type = match elem_type { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_wasm_elem_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `next` [INFO] [stdout] --> src/parser.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | let next = clone.next(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_next` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `init` is never read [INFO] [stdout] --> src/parser.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 70 | FieldDecl { [INFO] [stdout] | --------- field in this variant [INFO] [stdout] ... [INFO] [stdout] 73 | init: Option, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Assignment` is never constructed [INFO] [stdout] --> src/parser.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 64 | pub enum Stmt { [INFO] [stdout] | ---- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 81 | Assignment { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `main` is never used [INFO] [stdout] --> src/parser.rs:1148:4 [INFO] [stdout] | [INFO] [stdout] 1148 | fn main() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/parser.rs:1522:13 [INFO] [stdout] | [INFO] [stdout] 1522 | let ast = parse(input).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/parser.rs:196:22 [INFO] [stdout] | [INFO] [stdout] 196 | _ if c.is_digit(10) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/parser.rs:232:16 [INFO] [stdout] | [INFO] [stdout] 232 | if c.is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:259:16 [INFO] [stdout] | [INFO] [stdout] 259 | if (op == "<" && next == '=') [INFO] [stdout] | ________________^ [INFO] [stdout] 260 | | || (op == ">" && next == '=') [INFO] [stdout] 261 | | || (op == "!" && next == '=') [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] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 261 - || (op == "!" && next == '=') [INFO] [stdout] 259 + if !(next != '=' || op != "<" && op != ">" && op != "!") [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 261 - || (op == "!" && next == '=') [INFO] [stdout] 259 + if (op == "!" || op == ">" || op == "<") && next == '=' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:259:16 [INFO] [stdout] | [INFO] [stdout] 259 | if (op == "<" && next == '=') [INFO] [stdout] | ________________^ [INFO] [stdout] 260 | | || (op == ">" && next == '=') [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] help: try [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 259 + if !(next != '=' || op != "<" && op != ">") [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 259 + if (op == ">" || op == "<") && next == '=' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(&next) = self.peek_char() { [INFO] [stdout] 259 | | if (op == "<" && next == '=') [INFO] [stdout] 260 | | || (op == ">" && next == '=') [INFO] [stdout] 261 | | || (op == "!" && next == '=') [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [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] 258 ~ if let Some(&next) = self.peek_char() [INFO] [stdout] 259 ~ && ((op == "<" && next == '=') [INFO] [stdout] 260 | || (op == ">" && next == '=') [INFO] [stdout] ... [INFO] [stdout] 272 | || (op == "&" && next == '=') [INFO] [stdout] 273 ~ || (op == "|" && next == '=')) [INFO] [stdout] 274 | { [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:279:17 [INFO] [stdout] | [INFO] [stdout] 279 | / if op == ">>" { [INFO] [stdout] 280 | | if let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | | if third == '>' { [INFO] [stdout] 282 | | op.push(third); [INFO] [stdout] ... | [INFO] [stdout] 286 | | } [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] 279 ~ if op == ">>" [INFO] [stdout] 280 ~ && let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | if third == '>' { [INFO] [stdout] ... [INFO] [stdout] 284 | } [INFO] [stdout] 285 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:280:21 [INFO] [stdout] | [INFO] [stdout] 280 | / if let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | | if third == '>' { [INFO] [stdout] 282 | | op.push(third); [INFO] [stdout] 283 | | self.next_char(); [INFO] [stdout] 284 | | } [INFO] [stdout] 285 | | } [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] 280 ~ if let Some(&third) = self.peek_char() [INFO] [stdout] 281 ~ && third == '>' { [INFO] [stdout] 282 | op.push(third); [INFO] [stdout] 283 | self.next_char(); [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.lookahead.get(0)` [INFO] [stdout] --> src/parser.rs:376:9 [INFO] [stdout] | [INFO] [stdout] 376 | self.lookahead.get(0).cloned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.lookahead.front()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:393:9 [INFO] [stdout] | [INFO] [stdout] 393 | self.peek().map_or(false, |t| t == *token) [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] 393 - self.peek().map_or(false, |t| t == *token) [INFO] [stdout] 393 + self.peek().is_some_and(|t| t == *token) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:406:9 [INFO] [stdout] | [INFO] [stdout] 406 | / if let Some(Token::Operator(op)) = self.peek() { [INFO] [stdout] 407 | | if ops.contains(&op.as_str()) { [INFO] [stdout] 408 | | self.advance(); [INFO] [stdout] 409 | | return Some(op); [INFO] [stdout] 410 | | } [INFO] [stdout] 411 | | } [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] 406 ~ if let Some(Token::Operator(op)) = self.peek() [INFO] [stdout] 407 ~ && ops.contains(&op.as_str()) { [INFO] [stdout] 408 | self.advance(); [INFO] [stdout] 409 | return Some(op); [INFO] [stdout] 410 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `is_main` [INFO] [stdout] --> src/codegen.rs:183:9 [INFO] [stdout] | [INFO] [stdout] 183 | is_main: bool, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_is_main` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:453:39 [INFO] [stdout] | [INFO] [stdout] 453 | let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 454 | | (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 455 | | _ => false, [INFO] [stdout] 456 | | }; [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 453 - let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] 454 - (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 455 - _ => false, [INFO] [stdout] 456 - }; [INFO] [stdout] 453 + let is_function = matches!((self.peek_n(idx), self.peek_n(idx+1)), (Some(Token::Identifier(_)), Some(Token::Delimiter('(')))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:477:35 [INFO] [stdout] | [INFO] [stdout] 477 | let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 478 | | (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 479 | | _ => false, [INFO] [stdout] 480 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 477 - let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] 478 - (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 479 - _ => false, [INFO] [stdout] 480 - }; [INFO] [stdout] 477 + let is_function = matches!((self.peek_n(idx), self.peek_n(idx+1)), (Some(Token::Identifier(_)), Some(Token::Delimiter('(')))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:519:21 [INFO] [stdout] | [INFO] [stdout] 519 | / match self.peek_n(2) { [INFO] [stdout] 520 | | Some(Token::Delimiter('(')) => true, [INFO] [stdout] 521 | | _ => false, [INFO] [stdout] 522 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 519 - match self.peek_n(2) { [INFO] [stdout] 520 - Some(Token::Delimiter('(')) => true, [INFO] [stdout] 521 - _ => false, [INFO] [stdout] 522 - } [INFO] [stdout] 519 + matches!(self.peek_n(2), Some(Token::Delimiter('('))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/codegen.rs:727:13 [INFO] [stdout] | [INFO] [stdout] 727 | _ => "".to_string(), [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/codegen.rs:727:13 [INFO] [stdout] | [INFO] [stdout] 472 | Expr::LiteralInt(n) => format!("i32.const {}", n), [INFO] [stdout] | ------------------- matches some of the same values [INFO] [stdout] 473 | Expr::LiteralBool(b) => format!("i32.const {}", if *b { 1 } else { 0 }), [INFO] [stdout] | -------------------- matches some of the same values [INFO] [stdout] 474 | Expr::LiteralString(s) => { [INFO] [stdout] | ---------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 484 | Expr::LiteralNull => "ref.null $String".to_string(), [INFO] [stdout] | ----------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 727 | _ => "".to_string(), [INFO] [stdout] | ^ ...and 9 other patterns collectively make this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `wasm_elem_type` [INFO] [stdout] --> src/codegen.rs:775:17 [INFO] [stdout] | [INFO] [stdout] 775 | let wasm_elem_type = match elem_type { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_wasm_elem_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/codegen.rs:107:62 [INFO] [stdout] | [INFO] [stdout] 107 | let elem_type = if array_type.starts_with("int") { [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 108 | | "i32".to_string() [INFO] [stdout] 109 | | } else if array_type.starts_with("boolean") { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/codegen.rs:109:57 [INFO] [stdout] | [INFO] [stdout] 109 | } else if array_type.starts_with("boolean") { [INFO] [stdout] | _________________________________________________________^ [INFO] [stdout] 110 | | "i32".to_string() [INFO] [stdout] 111 | | } else if array_type.starts_with("String") { [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:44 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^ help: change this to: `name` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:51 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:65 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:74 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:50 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:57 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `method_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:71 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:85 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:94 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:149:55 [INFO] [stdout] | [INFO] [stdout] 149 | let wasm_type = self.type_to_wasm(&var_type); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:152:56 [INFO] [stdout] | [INFO] [stdout] 152 | let value = self.generate_expr(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/codegen.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | self.output.borrow_mut().push_str(")"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `self.output.borrow_mut().push(')')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:305:17 [INFO] [stdout] | [INFO] [stdout] 305 | / if let Some(expr) = init { [INFO] [stdout] 306 | | let value = self.generate_expr(&expr); [INFO] [stdout] 307 | | self.emit(&format!("(local.set ${} ({}))\n", name, value)); [INFO] [stdout] 308 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/codegen.rs:303:40 [INFO] [stdout] | [INFO] [stdout] 303 | Stmt::VariableDecl { name, init, .. } => { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 304 | // Already added to locals in Block [INFO] [stdout] 305 | if let Some(expr) = 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] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:294:21 [INFO] [stdout] | [INFO] [stdout] 294 | / if let Stmt::VariableDecl { name, var_type, .. } = s { [INFO] [stdout] 295 | | if let Some(locals) = self.local_vars_stack.last_mut() { [INFO] [stdout] 296 | | locals.insert(name.clone(), var_type.clone()); [INFO] [stdout] 297 | | } [INFO] [stdout] 298 | | } [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] 294 ~ if let Stmt::VariableDecl { name, var_type, .. } = s [INFO] [stdout] 295 ~ && let Some(locals) = self.local_vars_stack.last_mut() { [INFO] [stdout] 296 | locals.insert(name.clone(), var_type.clone()); [INFO] [stdout] 297 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:306:52 [INFO] [stdout] | [INFO] [stdout] 306 | let value = self.generate_expr(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen.rs:478:21 [INFO] [stdout] | [INFO] [stdout] 478 | format!("array.new $String (i32.const 0) (i32.const 0)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"array.new $String (i32.const 0) (i32.const 0)".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: field `init` is never read [INFO] [stdout] --> src/parser.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 70 | FieldDecl { [INFO] [stdout] | --------- field in this variant [INFO] [stdout] ... [INFO] [stdout] 73 | init: Option, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Assignment` is never constructed [INFO] [stdout] --> src/parser.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 64 | pub enum Stmt { [INFO] [stdout] | ---- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 81 | Assignment { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `main` is never used [INFO] [stdout] --> src/parser.rs:1148:4 [INFO] [stdout] | [INFO] [stdout] 1148 | fn main() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:736:21 [INFO] [stdout] | [INFO] [stdout] 736 | / if let Some(var_type) = locals.get(name) { [INFO] [stdout] 737 | | if self.classes.contains_key(var_type) { [INFO] [stdout] 738 | | return var_type.clone(); [INFO] [stdout] 739 | | } [INFO] [stdout] 740 | | } [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] 736 ~ if let Some(var_type) = locals.get(name) [INFO] [stdout] 737 ~ && self.classes.contains_key(var_type) { [INFO] [stdout] 738 | return var_type.clone(); [INFO] [stdout] 739 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:756:25 [INFO] [stdout] | [INFO] [stdout] 756 | / if let Some(var_type) = locals.get(array_name) { [INFO] [stdout] 757 | | if var_type.ends_with("[]") { [INFO] [stdout] 758 | | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 759 | | if self.classes.contains_key(elem_type) { [INFO] [stdout] ... | [INFO] [stdout] 763 | | } [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] 756 ~ if let Some(var_type) = locals.get(array_name) [INFO] [stdout] 757 ~ && var_type.ends_with("[]") { [INFO] [stdout] 758 | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] ... [INFO] [stdout] 761 | } [INFO] [stdout] 762 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/codegen.rs:774:29 [INFO] [stdout] | [INFO] [stdout] 774 | let elem_type = &t[..t.len() - 2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/codegen.rs:773:9 [INFO] [stdout] | [INFO] [stdout] 773 | if t.ends_with("[]") { [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] 773 ~ if let Some(elem_type) = t.strip_suffix("[]") { [INFO] [stdout] 774 ~ let wasm_elem_type = match elem_type { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/parser.rs:196:22 [INFO] [stdout] | [INFO] [stdout] 196 | _ if c.is_digit(10) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:801:13 [INFO] [stdout] | [INFO] [stdout] 801 | / if let Stmt::FunctionDecl { name, body, .. } = stmt { [INFO] [stdout] 802 | | if name == "main" { [INFO] [stdout] 803 | | return Some(body.clone()); [INFO] [stdout] 804 | | } [INFO] [stdout] 805 | | } [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] 801 ~ if let Stmt::FunctionDecl { name, body, .. } = stmt [INFO] [stdout] 802 ~ && name == "main" { [INFO] [stdout] 803 | return Some(body.clone()); [INFO] [stdout] 804 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/parser.rs:232:16 [INFO] [stdout] | [INFO] [stdout] 232 | if c.is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:835:17 [INFO] [stdout] | [INFO] [stdout] 835 | / if !param_names.contains(name) && !locals.iter().any(|(n, _)| n == name) { [INFO] [stdout] 836 | | locals.push((name.clone(), var_type.clone())); [INFO] [stdout] 837 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 834 ~ Stmt::VariableDecl { var_type, name, .. } [INFO] [stdout] 835 ~ if !param_names.contains(name) && !locals.iter().any(|(n, _)| n == name) => { [INFO] [stdout] 836 | locals.push((name.clone(), var_type.clone())); [INFO] [stdout] 837 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:259:16 [INFO] [stdout] | [INFO] [stdout] 259 | if (op == "<" && next == '=') [INFO] [stdout] | ________________^ [INFO] [stdout] 260 | | || (op == ">" && next == '=') [INFO] [stdout] 261 | | || (op == "!" && next == '=') [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] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 261 - || (op == "!" && next == '=') [INFO] [stdout] 259 + if !(next != '=' || op != "<" && op != ">" && op != "!") [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 261 - || (op == "!" && next == '=') [INFO] [stdout] 259 + if (op == "!" || op == ">" || op == "<") && next == '=' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:887:17 [INFO] [stdout] | [INFO] [stdout] 887 | / if var_type.ends_with("[]") { [INFO] [stdout] 888 | | set.insert(var_type.clone()); [INFO] [stdout] 889 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 886 ~ Stmt::VariableDecl { var_type, .. } | Stmt::FieldDecl { var_type, .. } [INFO] [stdout] 887 ~ if var_type.ends_with("[]") => { [INFO] [stdout] 888 | set.insert(var_type.clone()); [INFO] [stdout] 889 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:259:16 [INFO] [stdout] | [INFO] [stdout] 259 | if (op == "<" && next == '=') [INFO] [stdout] | ________________^ [INFO] [stdout] 260 | | || (op == ">" && next == '=') [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] help: try [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 259 + if !(next != '=' || op != "<" && op != ">") [INFO] [stdout] | [INFO] [stdout] 259 - if (op == "<" && next == '=') [INFO] [stdout] 260 - || (op == ">" && next == '=') [INFO] [stdout] 259 + if (op == ">" || op == "<") && next == '=' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(&next) = self.peek_char() { [INFO] [stdout] 259 | | if (op == "<" && next == '=') [INFO] [stdout] 260 | | || (op == ">" && next == '=') [INFO] [stdout] 261 | | || (op == "!" && next == '=') [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [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] 258 ~ if let Some(&next) = self.peek_char() [INFO] [stdout] 259 ~ && ((op == "<" && next == '=') [INFO] [stdout] 260 | || (op == ">" && next == '=') [INFO] [stdout] ... [INFO] [stdout] 272 | || (op == "&" && next == '=') [INFO] [stdout] 273 ~ || (op == "|" && next == '=')) [INFO] [stdout] 274 | { [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:279:17 [INFO] [stdout] | [INFO] [stdout] 279 | / if op == ">>" { [INFO] [stdout] 280 | | if let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | | if third == '>' { [INFO] [stdout] 282 | | op.push(third); [INFO] [stdout] ... | [INFO] [stdout] 286 | | } [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] 279 ~ if op == ">>" [INFO] [stdout] 280 ~ && let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | if third == '>' { [INFO] [stdout] ... [INFO] [stdout] 284 | } [INFO] [stdout] 285 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:280:21 [INFO] [stdout] | [INFO] [stdout] 280 | / if let Some(&third) = self.peek_char() { [INFO] [stdout] 281 | | if third == '>' { [INFO] [stdout] 282 | | op.push(third); [INFO] [stdout] 283 | | self.next_char(); [INFO] [stdout] 284 | | } [INFO] [stdout] 285 | | } [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] 280 ~ if let Some(&third) = self.peek_char() [INFO] [stdout] 281 ~ && third == '>' { [INFO] [stdout] 282 | op.push(third); [INFO] [stdout] 283 | self.next_char(); [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:939:21 [INFO] [stdout] | [INFO] [stdout] 939 | / if let Some(var_type) = locals.get(name) { [INFO] [stdout] 940 | | if var_type.ends_with("[]") { [INFO] [stdout] 941 | | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 942 | | return format!("${}Array", elem_type); [INFO] [stdout] 943 | | } [INFO] [stdout] 944 | | } [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] 939 ~ if let Some(var_type) = locals.get(name) [INFO] [stdout] 940 ~ && var_type.ends_with("[]") { [INFO] [stdout] 941 | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 942 | return format!("${}Array", elem_type); [INFO] [stdout] 943 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:958:17 [INFO] [stdout] | [INFO] [stdout] 958 | / if let Some(else_stmt) = else_block { [INFO] [stdout] 959 | | self.has_guaranteed_return(then_block) && self.has_guaranteed_return(else_stmt) [INFO] [stdout] 960 | | } else { [INFO] [stdout] 961 | | false // No else branch means no guaranteed return [INFO] [stdout] 962 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/codegen.rs:956:36 [INFO] [stdout] | [INFO] [stdout] 956 | Stmt::If { then_block, else_block, .. } => { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 957 | // Both branches must guarantee a return [INFO] [stdout] 958 | if let Some(else_stmt) = else_block { [INFO] [stdout] | ^^^^^^^^^^^^^^^ with this pattern, prefixed by `else_block: ` [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: accessing first element with `self.lookahead.get(0)` [INFO] [stdout] --> src/parser.rs:376:9 [INFO] [stdout] | [INFO] [stdout] 376 | self.lookahead.get(0).cloned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.lookahead.front()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:393:9 [INFO] [stdout] | [INFO] [stdout] 393 | self.peek().map_or(false, |t| t == *token) [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] 393 - self.peek().map_or(false, |t| t == *token) [INFO] [stdout] 393 + self.peek().is_some_and(|t| t == *token) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser.rs:406:9 [INFO] [stdout] | [INFO] [stdout] 406 | / if let Some(Token::Operator(op)) = self.peek() { [INFO] [stdout] 407 | | if ops.contains(&op.as_str()) { [INFO] [stdout] 408 | | self.advance(); [INFO] [stdout] 409 | | return Some(op); [INFO] [stdout] 410 | | } [INFO] [stdout] 411 | | } [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] 406 ~ if let Some(Token::Operator(op)) = self.peek() [INFO] [stdout] 407 ~ && ops.contains(&op.as_str()) { [INFO] [stdout] 408 | self.advance(); [INFO] [stdout] 409 | return Some(op); [INFO] [stdout] 410 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:453:39 [INFO] [stdout] | [INFO] [stdout] 453 | let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 454 | | (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 455 | | _ => false, [INFO] [stdout] 456 | | }; [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 453 - let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] 454 - (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 455 - _ => false, [INFO] [stdout] 456 - }; [INFO] [stdout] 453 + let is_function = matches!((self.peek_n(idx), self.peek_n(idx+1)), (Some(Token::Identifier(_)), Some(Token::Delimiter('(')))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:477:35 [INFO] [stdout] | [INFO] [stdout] 477 | let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 478 | | (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 479 | | _ => false, [INFO] [stdout] 480 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 477 - let is_function = match (self.peek_n(idx), self.peek_n(idx+1)) { [INFO] [stdout] 478 - (Some(Token::Identifier(_)), Some(Token::Delimiter('('))) => true, [INFO] [stdout] 479 - _ => false, [INFO] [stdout] 480 - }; [INFO] [stdout] 477 + let is_function = matches!((self.peek_n(idx), self.peek_n(idx+1)), (Some(Token::Identifier(_)), Some(Token::Delimiter('(')))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:519:21 [INFO] [stdout] | [INFO] [stdout] 519 | / match self.peek_n(2) { [INFO] [stdout] 520 | | Some(Token::Delimiter('(')) => true, [INFO] [stdout] 521 | | _ => false, [INFO] [stdout] 522 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 519 - match self.peek_n(2) { [INFO] [stdout] 520 - Some(Token::Delimiter('(')) => true, [INFO] [stdout] 521 - _ => false, [INFO] [stdout] 522 - } [INFO] [stdout] 519 + matches!(self.peek_n(2), Some(Token::Delimiter('('))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | / if let Ok(byte_val) = val.get(&mut caller, i) { [INFO] [stdout] 150 | | if let Some(byte) = byte_val.i32() { [INFO] [stdout] 151 | | print!("{}", byte as u8 as char); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let Ok(byte_val) = val.get(&mut caller, i) [INFO] [stdout] 150 ~ && let Some(byte) = byte_val.i32() { [INFO] [stdout] 151 | print!("{}", byte as u8 as char); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:173:13 [INFO] [stdout] | [INFO] [stdout] 173 | / if let Ok(byte_val) = val.get(&mut caller, i) { [INFO] [stdout] 174 | | if let Some(byte) = byte_val.i32() { [INFO] [stdout] 175 | | print!("{}", byte as u8 as char); [INFO] [stdout] 176 | | } [INFO] [stdout] 177 | | } [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] 173 ~ if let Ok(byte_val) = val.get(&mut caller, i) [INFO] [stdout] 174 ~ && let Some(byte) = byte_val.i32() { [INFO] [stdout] 175 | print!("{}", byte as u8 as char); [INFO] [stdout] 176 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:198:90 [INFO] [stdout] | [INFO] [stdout] 198 | let wasm_binary = match wat::Parser::default().parse_str(Some(Path::new(&filename)), &wat_code) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `wat_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 `if` has identical blocks [INFO] [stdout] --> src/codegen.rs:107:62 [INFO] [stdout] | [INFO] [stdout] 107 | let elem_type = if array_type.starts_with("int") { [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 108 | | "i32".to_string() [INFO] [stdout] 109 | | } else if array_type.starts_with("boolean") { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/codegen.rs:109:57 [INFO] [stdout] | [INFO] [stdout] 109 | } else if array_type.starts_with("boolean") { [INFO] [stdout] | _________________________________________________________^ [INFO] [stdout] 110 | | "i32".to_string() [INFO] [stdout] 111 | | } else if array_type.starts_with("String") { [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:44 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^ help: change this to: `name` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:51 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:65 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:139:74 [INFO] [stdout] | [INFO] [stdout] 139 | self.generate_function(&name, &return_type, ¶ms, &body, false); [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:50 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:57 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `method_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:71 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:85 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:144:94 [INFO] [stdout] | [INFO] [stdout] 144 | ... self.generate_method(&name, &method_name, &return_type, ¶ms, &body); [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:149:55 [INFO] [stdout] | [INFO] [stdout] 149 | let wasm_type = self.type_to_wasm(&var_type); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:152:56 [INFO] [stdout] | [INFO] [stdout] 152 | let value = self.generate_expr(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/codegen.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | self.output.borrow_mut().push_str(")"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `self.output.borrow_mut().push(')')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:305:17 [INFO] [stdout] | [INFO] [stdout] 305 | / if let Some(expr) = init { [INFO] [stdout] 306 | | let value = self.generate_expr(&expr); [INFO] [stdout] 307 | | self.emit(&format!("(local.set ${} ({}))\n", name, value)); [INFO] [stdout] 308 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/codegen.rs:303:40 [INFO] [stdout] | [INFO] [stdout] 303 | Stmt::VariableDecl { name, init, .. } => { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 304 | // Already added to locals in Block [INFO] [stdout] 305 | if let Some(expr) = 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] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:294:21 [INFO] [stdout] | [INFO] [stdout] 294 | / if let Stmt::VariableDecl { name, var_type, .. } = s { [INFO] [stdout] 295 | | if let Some(locals) = self.local_vars_stack.last_mut() { [INFO] [stdout] 296 | | locals.insert(name.clone(), var_type.clone()); [INFO] [stdout] 297 | | } [INFO] [stdout] 298 | | } [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] 294 ~ if let Stmt::VariableDecl { name, var_type, .. } = s [INFO] [stdout] 295 ~ && let Some(locals) = self.local_vars_stack.last_mut() { [INFO] [stdout] 296 | locals.insert(name.clone(), var_type.clone()); [INFO] [stdout] 297 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen.rs:306:52 [INFO] [stdout] | [INFO] [stdout] 306 | let value = self.generate_expr(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen.rs:478:21 [INFO] [stdout] | [INFO] [stdout] 478 | format!("array.new $String (i32.const 0) (i32.const 0)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"array.new $String (i32.const 0) (i32.const 0)".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: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:736:21 [INFO] [stdout] | [INFO] [stdout] 736 | / if let Some(var_type) = locals.get(name) { [INFO] [stdout] 737 | | if self.classes.contains_key(var_type) { [INFO] [stdout] 738 | | return var_type.clone(); [INFO] [stdout] 739 | | } [INFO] [stdout] 740 | | } [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] 736 ~ if let Some(var_type) = locals.get(name) [INFO] [stdout] 737 ~ && self.classes.contains_key(var_type) { [INFO] [stdout] 738 | return var_type.clone(); [INFO] [stdout] 739 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:756:25 [INFO] [stdout] | [INFO] [stdout] 756 | / if let Some(var_type) = locals.get(array_name) { [INFO] [stdout] 757 | | if var_type.ends_with("[]") { [INFO] [stdout] 758 | | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 759 | | if self.classes.contains_key(elem_type) { [INFO] [stdout] ... | [INFO] [stdout] 763 | | } [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] 756 ~ if let Some(var_type) = locals.get(array_name) [INFO] [stdout] 757 ~ && var_type.ends_with("[]") { [INFO] [stdout] 758 | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] ... [INFO] [stdout] 761 | } [INFO] [stdout] 762 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/codegen.rs:774:29 [INFO] [stdout] | [INFO] [stdout] 774 | let elem_type = &t[..t.len() - 2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/codegen.rs:773:9 [INFO] [stdout] | [INFO] [stdout] 773 | if t.ends_with("[]") { [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] 773 ~ if let Some(elem_type) = t.strip_suffix("[]") { [INFO] [stdout] 774 ~ let wasm_elem_type = match elem_type { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:801:13 [INFO] [stdout] | [INFO] [stdout] 801 | / if let Stmt::FunctionDecl { name, body, .. } = stmt { [INFO] [stdout] 802 | | if name == "main" { [INFO] [stdout] 803 | | return Some(body.clone()); [INFO] [stdout] 804 | | } [INFO] [stdout] 805 | | } [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] 801 ~ if let Stmt::FunctionDecl { name, body, .. } = stmt [INFO] [stdout] 802 ~ && name == "main" { [INFO] [stdout] 803 | return Some(body.clone()); [INFO] [stdout] 804 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:835:17 [INFO] [stdout] | [INFO] [stdout] 835 | / if !param_names.contains(name) && !locals.iter().any(|(n, _)| n == name) { [INFO] [stdout] 836 | | locals.push((name.clone(), var_type.clone())); [INFO] [stdout] 837 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 834 ~ Stmt::VariableDecl { var_type, name, .. } [INFO] [stdout] 835 ~ if !param_names.contains(name) && !locals.iter().any(|(n, _)| n == name) => { [INFO] [stdout] 836 | locals.push((name.clone(), var_type.clone())); [INFO] [stdout] 837 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:887:17 [INFO] [stdout] | [INFO] [stdout] 887 | / if var_type.ends_with("[]") { [INFO] [stdout] 888 | | set.insert(var_type.clone()); [INFO] [stdout] 889 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 886 ~ Stmt::VariableDecl { var_type, .. } | Stmt::FieldDecl { var_type, .. } [INFO] [stdout] 887 ~ if var_type.ends_with("[]") => { [INFO] [stdout] 888 | set.insert(var_type.clone()); [INFO] [stdout] 889 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/codegen.rs:939:21 [INFO] [stdout] | [INFO] [stdout] 939 | / if let Some(var_type) = locals.get(name) { [INFO] [stdout] 940 | | if var_type.ends_with("[]") { [INFO] [stdout] 941 | | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 942 | | return format!("${}Array", elem_type); [INFO] [stdout] 943 | | } [INFO] [stdout] 944 | | } [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] 939 ~ if let Some(var_type) = locals.get(name) [INFO] [stdout] 940 ~ && var_type.ends_with("[]") { [INFO] [stdout] 941 | let elem_type = &var_type[..var_type.len() - 2]; [INFO] [stdout] 942 | return format!("${}Array", elem_type); [INFO] [stdout] 943 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> src/codegen.rs:958:17 [INFO] [stdout] | [INFO] [stdout] 958 | / if let Some(else_stmt) = else_block { [INFO] [stdout] 959 | | self.has_guaranteed_return(then_block) && self.has_guaranteed_return(else_stmt) [INFO] [stdout] 960 | | } else { [INFO] [stdout] 961 | | false // No else branch means no guaranteed return [INFO] [stdout] 962 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/codegen.rs:956:36 [INFO] [stdout] | [INFO] [stdout] 956 | Stmt::If { then_block, else_block, .. } => { [INFO] [stdout] | ^^^^^^^^^^ replace this binding [INFO] [stdout] 957 | // Both branches must guarantee a return [INFO] [stdout] 958 | if let Some(else_stmt) = else_block { [INFO] [stdout] | ^^^^^^^^^^^^^^^ with this pattern, prefixed by `else_block: ` [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/main.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | / if let Ok(byte_val) = val.get(&mut caller, i) { [INFO] [stdout] 150 | | if let Some(byte) = byte_val.i32() { [INFO] [stdout] 151 | | print!("{}", byte as u8 as char); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let Ok(byte_val) = val.get(&mut caller, i) [INFO] [stdout] 150 ~ && let Some(byte) = byte_val.i32() { [INFO] [stdout] 151 | print!("{}", byte as u8 as char); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:173:13 [INFO] [stdout] | [INFO] [stdout] 173 | / if let Ok(byte_val) = val.get(&mut caller, i) { [INFO] [stdout] 174 | | if let Some(byte) = byte_val.i32() { [INFO] [stdout] 175 | | print!("{}", byte as u8 as char); [INFO] [stdout] 176 | | } [INFO] [stdout] 177 | | } [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] 173 ~ if let Ok(byte_val) = val.get(&mut caller, i) [INFO] [stdout] 174 ~ && let Some(byte) = byte_val.i32() { [INFO] [stdout] 175 | print!("{}", byte as u8 as char); [INFO] [stdout] 176 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:198:90 [INFO] [stdout] | [INFO] [stdout] 198 | let wasm_binary = match wat::Parser::default().parse_str(Some(Path::new(&filename)), &wat_code) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `wat_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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 40s [INFO] running `Command { std: "docker" "inspect" "28f913fba4d3805cc652f82493b095c4c0cb24e1ffdf8898598379e29ed692b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "28f913fba4d3805cc652f82493b095c4c0cb24e1ffdf8898598379e29ed692b1", kill_on_drop: false }` [INFO] [stdout] 28f913fba4d3805cc652f82493b095c4c0cb24e1ffdf8898598379e29ed692b1