[INFO] cloning repository https://github.com/CarterTS/LLVMCompiler [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/CarterTS/LLVMCompiler" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCarterTS%2FLLVMCompiler", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCarterTS%2FLLVMCompiler'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 74993c1cac7deb0116e337878b055d537fd3306e [INFO] linting CarterTS/LLVMCompiler against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCarterTS%2FLLVMCompiler" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/CarterTS/LLVMCompiler [INFO] finished tweaking git repo https://github.com/CarterTS/LLVMCompiler [INFO] tweaked toml for git repo https://github.com/CarterTS/LLVMCompiler written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/CarterTS/LLVMCompiler 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/CarterTS/LLVMCompiler already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 2f8038c31858cdd4826043c7889be9cdcb415a732b6e27073655d0a97b1372be [INFO] running `Command { std: "docker" "start" "-a" "2f8038c31858cdd4826043c7889be9cdcb415a732b6e27073655d0a97b1372be", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2f8038c31858cdd4826043c7889be9cdcb415a732b6e27073655d0a97b1372be", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2f8038c31858cdd4826043c7889be9cdcb415a732b6e27073655d0a97b1372be", kill_on_drop: false }` [INFO] [stdout] 2f8038c31858cdd4826043c7889be9cdcb415a732b6e27073655d0a97b1372be [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 5438c27163d17b610e0adab2eae8261d9fc4c8aefce49aa2e27512743127096f [INFO] running `Command { std: "docker" "start" "-a" "5438c27163d17b610e0adab2eae8261d9fc4c8aefce49aa2e27512743127096f", kill_on_drop: false }` [INFO] [stderr] Compiling memchr v2.3.3 [INFO] [stderr] Checking regex-syntax v0.6.18 [INFO] [stderr] Checking thread_local v1.0.1 [INFO] [stderr] Checking aho-corasick v0.7.13 [INFO] [stderr] Checking regex v1.3.9 [INFO] [stderr] Checking compiler v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/tokenizer/tokenize.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/tokenizer/stream.rs:3:28 [INFO] [stdout] | [INFO] [stdout] 3 | static DEFAULT_FILE_NAME: &'static str = "[unknown]"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | filename: filename [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/irgen/expression.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | children: children, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/tokenizer/tokenize.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/tokenizer/stream.rs:3:28 [INFO] [stdout] | [INFO] [stdout] 3 | static DEFAULT_FILE_NAME: &'static str = "[unknown]"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | filename: filename [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/irgen/types.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | is_ref: is_ref [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `is_ref` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/irgen/expression.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | children: children, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/irgen/types.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | is_ref: is_ref [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `is_ref` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/tokenizer/tokenize.rs:29:12 [INFO] [stdout] | [INFO] [stdout] 29 | if self.current_data.len() != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.current_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/tokenizer/tokenize.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if self.current_data.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.current_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer/tokenize.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | / loop [INFO] [stdout] 71 | | { [INFO] [stdout] 72 | | match tokenizer.source.current() [INFO] [stdout] ... | [INFO] [stdout] 193 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(current) = tokenizer.source.current() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/tokenizer/tokenize.rs:29:12 [INFO] [stdout] | [INFO] [stdout] 29 | if self.current_data.len() != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.current_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/tokenizer/tokenize.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if self.current_data.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.current_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer/tokenize.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | / loop [INFO] [stdout] 71 | | { [INFO] [stdout] 72 | | match tokenizer.source.current() [INFO] [stdout] ... | [INFO] [stdout] 193 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(current) = tokenizer.source.current() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/tokenizer/stream.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | / match value [INFO] [stdout] 43 | | { [INFO] [stdout] 44 | | '\n' => {self.row += 1; self.col = 1;}, [INFO] [stdout] 45 | | _ => {} [INFO] [stdout] 46 | | }; [INFO] [stdout] | |_________^ help: try: `if value == '\n' {self.row += 1; self.col = 1;}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_none` [INFO] [stdout] --> src/tokenizer/stream.rs:95:23 [INFO] [stdout] | [INFO] [stdout] 89 | if v.is_none() [INFO] [stdout] | -------------- help: try: `if let Some() = v` [INFO] [stdout] ... [INFO] [stdout] 95 | Some((v.unwrap(), self.location.clone())) [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 `v` after checking its variant with `is_none` [INFO] [stdout] --> src/tokenizer/stream.rs:116:23 [INFO] [stdout] | [INFO] [stdout] 110 | if v.is_none() [INFO] [stdout] | -------------- help: try: `if let Some() = v` [INFO] [stdout] ... [INFO] [stdout] 116 | Some((v.unwrap(), self.location.clone())) [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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/tokenizer/stream.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | / match value [INFO] [stdout] 43 | | { [INFO] [stdout] 44 | | '\n' => {self.row += 1; self.col = 1;}, [INFO] [stdout] 45 | | _ => {} [INFO] [stdout] 46 | | }; [INFO] [stdout] | |_________^ help: try: `if value == '\n' {self.row += 1; self.col = 1;}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_none` [INFO] [stdout] --> src/tokenizer/stream.rs:95:23 [INFO] [stdout] | [INFO] [stdout] 89 | if v.is_none() [INFO] [stdout] | -------------- help: try: `if let Some() = v` [INFO] [stdout] ... [INFO] [stdout] 95 | Some((v.unwrap(), self.location.clone())) [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 `v` after checking its variant with `is_none` [INFO] [stdout] --> src/tokenizer/stream.rs:116:23 [INFO] [stdout] | [INFO] [stdout] 110 | if v.is_none() [INFO] [stdout] | -------------- help: try: `if let Some() = v` [INFO] [stdout] ... [INFO] [stdout] 116 | Some((v.unwrap(), self.location.clone())) [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: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | if current_key.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:82:20 [INFO] [stdout] | [INFO] [stdout] 82 | if current_key.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:95:12 [INFO] [stdout] | [INFO] [stdout] 95 | if current_key.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constructor `error` has the same name as the type [INFO] [stdout] --> src/cli/errors.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | / pub fn error(msg: &str) -> Self [INFO] [stdout] 34 | | { [INFO] [stdout] 35 | | Self [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors [INFO] [stdout] = note: `#[warn(clippy::self_named_constructors)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | if current_key.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:82:20 [INFO] [stdout] | [INFO] [stdout] 82 | if current_key.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/options.rs:95:12 [INFO] [stdout] | [INFO] [stdout] 95 | if current_key.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current_key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cli/execute.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 13 | if !v.is_none() [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `v.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_none` [INFO] [stdout] --> src/cli/execute.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 13 | if !v.is_none() [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 14 | { [INFO] [stdout] 15 | input_files.push(v.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: constructor `error` has the same name as the type [INFO] [stdout] --> src/cli/errors.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | / pub fn error(msg: &str) -> Self [INFO] [stdout] 34 | | { [INFO] [stdout] 35 | | Self [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors [INFO] [stdout] = note: `#[warn(clippy::self_named_constructors)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cli/execute.rs:21:8 [INFO] [stdout] | [INFO] [stdout] 21 | if input_files.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input_files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cli/execute.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 13 | if !v.is_none() [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `v.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_none` [INFO] [stdout] --> src/cli/execute.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 13 | if !v.is_none() [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 14 | { [INFO] [stdout] 15 | input_files.push(v.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: length comparison to zero [INFO] [stdout] --> src/cli/execute.rs:21:8 [INFO] [stdout] | [INFO] [stdout] 21 | if input_files.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input_files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compile.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / match node.unwrap() [INFO] [stdout] 55 | | { [INFO] [stdout] 56 | | ParseTreeNode::Library(children) => [INFO] [stdout] ... | [INFO] [stdout] 69 | | _ => {} [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 ~ if let ParseTreeNode::Library(children) = node.unwrap() { [INFO] [stdout] 55 + for child in children [INFO] [stdout] 56 + { [INFO] [stdout] 57 + let mut function = irgen::Function::from_parse_tree_node(child)?; [INFO] [stdout] 58 + [INFO] [stdout] 59 + function = irgen::correct_types(function); [INFO] [stdout] 60 + [INFO] [stdout] 61 + function = irgen::optimize_function(function, optimization_level, !options.has_long_flag("nocomp")); [INFO] [stdout] 62 + [INFO] [stdout] 63 + functions.push(function); [INFO] [stdout] 64 + } [INFO] [stdout] 65 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compile.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / match node.unwrap() [INFO] [stdout] 55 | | { [INFO] [stdout] 56 | | ParseTreeNode::Library(children) => [INFO] [stdout] ... | [INFO] [stdout] 69 | | _ => {} [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 ~ if let ParseTreeNode::Library(children) = node.unwrap() { [INFO] [stdout] 55 + for child in children [INFO] [stdout] 56 + { [INFO] [stdout] 57 + let mut function = irgen::Function::from_parse_tree_node(child)?; [INFO] [stdout] 58 + [INFO] [stdout] 59 + function = irgen::correct_types(function); [INFO] [stdout] 60 + [INFO] [stdout] 61 + function = irgen::optimize_function(function, optimization_level, !options.has_long_flag("nocomp")); [INFO] [stdout] 62 + [INFO] [stdout] 63 + functions.push(function); [INFO] [stdout] 64 + } [INFO] [stdout] 65 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:86:43 [INFO] [stdout] | [INFO] [stdout] 86 | ParseTreeNode::Library(nodes) => (format!("Library"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Library".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:87:44 [INFO] [stdout] | [INFO] [stdout] 87 | ParseTreeNode::Function(nodes) => (format!("Function"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Function".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:88:45 [INFO] [stdout] | [INFO] [stdout] 88 | ParseTreeNode::Arguments(nodes) => (format!("Arguments"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Arguments".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:89:44 [INFO] [stdout] | [INFO] [stdout] 89 | ParseTreeNode::Argument(nodes) => (format!("Argument"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Argument".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:90:40 [INFO] [stdout] | [INFO] [stdout] 90 | ParseTreeNode::Type(nodes) => (format!("Type"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Type".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:93:45 [INFO] [stdout] | [INFO] [stdout] 93 | ParseTreeNode::Statement(nodes) => (format!("Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | ParseTreeNode::Statements(nodes) => (format!("Statements"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Statements".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:95:47 [INFO] [stdout] | [INFO] [stdout] 95 | ParseTreeNode::Assignments(nodes) => (format!("Assignments"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignments".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:86:43 [INFO] [stdout] | [INFO] [stdout] 86 | ParseTreeNode::Library(nodes) => (format!("Library"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Library".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:87:44 [INFO] [stdout] | [INFO] [stdout] 87 | ParseTreeNode::Function(nodes) => (format!("Function"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Function".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:96:46 [INFO] [stdout] | [INFO] [stdout] 96 | ParseTreeNode::Assignment(nodes) => (format!("Assignment"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignment".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:88:45 [INFO] [stdout] | [INFO] [stdout] 88 | ParseTreeNode::Arguments(nodes) => (format!("Arguments"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Arguments".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:100:55 [INFO] [stdout] | [INFO] [stdout] 100 | ParseTreeNode::AssignmentStatement(nodes) => (format!("Assignment Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignment Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | ParseTreeNode::IfStatement(nodes) => (format!("If Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"If Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:102:51 [INFO] [stdout] | [INFO] [stdout] 102 | ParseTreeNode::ReturnStatement(nodes) => (format!("Return Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Return Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:89:44 [INFO] [stdout] | [INFO] [stdout] 89 | ParseTreeNode::Argument(nodes) => (format!("Argument"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Argument".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:90:40 [INFO] [stdout] | [INFO] [stdout] 90 | ParseTreeNode::Type(nodes) => (format!("Type"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Type".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:93:45 [INFO] [stdout] | [INFO] [stdout] 93 | ParseTreeNode::Statement(nodes) => (format!("Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | ParseTreeNode::Statements(nodes) => (format!("Statements"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Statements".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:95:47 [INFO] [stdout] | [INFO] [stdout] 95 | ParseTreeNode::Assignments(nodes) => (format!("Assignments"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignments".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:103:45 [INFO] [stdout] | [INFO] [stdout] 103 | ParseTreeNode::WhileLoop(nodes) => (format!("While Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"While Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:96:46 [INFO] [stdout] | [INFO] [stdout] 96 | ParseTreeNode::Assignment(nodes) => (format!("Assignment"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignment".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:104:47 [INFO] [stdout] | [INFO] [stdout] 104 | ParseTreeNode::DoWhileLoop(nodes) => (format!("Do While Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Do While Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:105:40 [INFO] [stdout] | [INFO] [stdout] 105 | ParseTreeNode::Loop(nodes) => (format!("Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | ParseTreeNode::Empty => (format!("Empty"), vec![]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Empty".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:100:55 [INFO] [stdout] | [INFO] [stdout] 100 | ParseTreeNode::AssignmentStatement(nodes) => (format!("Assignment Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Assignment Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | ParseTreeNode::IfStatement(nodes) => (format!("If Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"If Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 116 | if mprev.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mprev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | println!("{}{}{}", mprev, if nodes.len() == 0 {"─"} else {"┬"}, text); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:124:8 [INFO] [stdout] | [INFO] [stdout] 124 | if mprev.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mprev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/parser/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:102:51 [INFO] [stdout] | [INFO] [stdout] 102 | ParseTreeNode::ReturnStatement(nodes) => (format!("Return Statement"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Return Statement".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:103:45 [INFO] [stdout] | [INFO] [stdout] 103 | ParseTreeNode::WhileLoop(nodes) => (format!("While Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"While Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:104:47 [INFO] [stdout] | [INFO] [stdout] 104 | ParseTreeNode::DoWhileLoop(nodes) => (format!("Do While Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Do While Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:105:40 [INFO] [stdout] | [INFO] [stdout] 105 | ParseTreeNode::Loop(nodes) => (format!("Loop"), nodes), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/node.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | ParseTreeNode::Empty => (format!("Empty"), vec![]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Empty".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 116 | if mprev.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mprev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | println!("{}{}{}", mprev, if nodes.len() == 0 {"─"} else {"┬"}, text); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/node.rs:124:8 [INFO] [stdout] | [INFO] [stdout] 124 | if mprev.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mprev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/parser/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `op` after checking its variant with `is_none` [INFO] [stdout] --> src/parser/parser.rs:611:55 [INFO] [stdout] | [INFO] [stdout] 602 | if op.is_none() [INFO] [stdout] | --------------- help: try: `if let Some() = op` [INFO] [stdout] ... [INFO] [stdout] 611 | Ok((stream, ParseTreeNode::Expression(op.unwrap(), vec![post]))) [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: called `unwrap` on `op` after checking its variant with `is_none` [INFO] [stdout] --> src/parser/parser.rs:611:55 [INFO] [stdout] | [INFO] [stdout] 602 | if op.is_none() [INFO] [stdout] | --------------- help: try: `if let Some() = op` [INFO] [stdout] ... [INFO] [stdout] 611 | Ok((stream, ParseTreeNode::Expression(op.unwrap(), vec![post]))) [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: called `unwrap` on `op` after checking its variant with `is_none` [INFO] [stdout] --> src/parser/parser.rs:776:55 [INFO] [stdout] | [INFO] [stdout] 761 | if op.is_none() [INFO] [stdout] | --------------- help: try: `if let Some() = op` [INFO] [stdout] ... [INFO] [stdout] 776 | Ok((stream, ParseTreeNode::Expression(op.unwrap(), vec![prev, post]))) [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: called `unwrap` on `op` after checking its variant with `is_none` [INFO] [stdout] --> src/parser/parser.rs:776:55 [INFO] [stdout] | [INFO] [stdout] 761 | if op.is_none() [INFO] [stdout] | --------------- help: try: `if let Some() = op` [INFO] [stdout] ... [INFO] [stdout] 776 | Ok((stream, ParseTreeNode::Expression(op.unwrap(), vec![prev, post]))) [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: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/instruction.rs:260:99 [INFO] [stdout] | [INFO] [stdout] 260 | refcell.borrow_mut().return_value = Value::Symbol(Symbol::new(String::from("R0"), return_type.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/instruction.rs:292:72 [INFO] [stdout] | [INFO] [stdout] 292 | self.symbol_table.insert(s.clone(), Symbol::new(s.clone(), t.clone())); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inst` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/instruction.rs:305:16 [INFO] [stdout] | [INFO] [stdout] 302 | if inst.is_some() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 305 | if inst.unwrap().opcode != OpCode::Call [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: called `unwrap` on `inst` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/instruction.rs:307:29 [INFO] [stdout] | [INFO] [stdout] 302 | if inst.is_some() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 307 | for val in &inst.unwrap().arguments [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/irgen/instruction.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | / match val [INFO] [stdout] 310 | | { [INFO] [stdout] 311 | | // If an argument is a label, add that label as a possible next result [INFO] [stdout] 312 | | Value::Label(s) => [INFO] [stdout] ... | [INFO] [stdout] 318 | | _ => {} [INFO] [stdout] 319 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 309 ~ if let Value::Label(s) = val { [INFO] [stdout] 310 + let v = *self.labels_reverse.get(s).unwrap(); [INFO] [stdout] 311 + [INFO] [stdout] 312 + result.push(v); [INFO] [stdout] 313 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:325:12 [INFO] [stdout] | [INFO] [stdout] 325 | if result.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!result.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/irgen/instruction.rs:367:9 [INFO] [stdout] | [INFO] [stdout] 367 | / if self.labels.contains_key(&index) [INFO] [stdout] 368 | | { [INFO] [stdout] 369 | | self.labels.get_mut(&index).unwrap().push(label.clone()); [INFO] [stdout] ... | [INFO] [stdout] 373 | | self.labels.insert(index, vec![label.clone()]); [INFO] [stdout] 374 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 367 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.labels.entry(index) { [INFO] [stdout] 368 + e.insert(vec![label.clone()]); [INFO] [stdout] 369 + } else { [INFO] [stdout] 370 + self.labels.get_mut(&index).unwrap().push(label.clone()); [INFO] [stdout] 371 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/instruction.rs:260:99 [INFO] [stdout] | [INFO] [stdout] 260 | refcell.borrow_mut().return_value = Value::Symbol(Symbol::new(String::from("R0"), return_type.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `return_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/instruction.rs:292:72 [INFO] [stdout] | [INFO] [stdout] 292 | self.symbol_table.insert(s.clone(), Symbol::new(s.clone(), t.clone())); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:439:12 [INFO] [stdout] | [INFO] [stdout] 439 | if self.continue_stack.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.continue_stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:452:12 [INFO] [stdout] | [INFO] [stdout] 452 | if self.break_stack.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.break_stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inst` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/instruction.rs:305:16 [INFO] [stdout] | [INFO] [stdout] 302 | if inst.is_some() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 305 | if inst.unwrap().opcode != OpCode::Call [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: called `unwrap` on `inst` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/instruction.rs:307:29 [INFO] [stdout] | [INFO] [stdout] 302 | if inst.is_some() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 307 | for val in &inst.unwrap().arguments [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: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:469:15 [INFO] [stdout] | [INFO] [stdout] 469 | while fronts.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fronts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/irgen/instruction.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | / match val [INFO] [stdout] 310 | | { [INFO] [stdout] 311 | | // If an argument is a label, add that label as a possible next result [INFO] [stdout] 312 | | Value::Label(s) => [INFO] [stdout] ... | [INFO] [stdout] 318 | | _ => {} [INFO] [stdout] 319 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 309 ~ if let Value::Label(s) = val { [INFO] [stdout] 310 + let v = *self.labels_reverse.get(s).unwrap(); [INFO] [stdout] 311 + [INFO] [stdout] 312 + result.push(v); [INFO] [stdout] 313 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:325:12 [INFO] [stdout] | [INFO] [stdout] 325 | if result.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!result.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/irgen/instruction.rs:367:9 [INFO] [stdout] | [INFO] [stdout] 367 | / if self.labels.contains_key(&index) [INFO] [stdout] 368 | | { [INFO] [stdout] 369 | | self.labels.get_mut(&index).unwrap().push(label.clone()); [INFO] [stdout] ... | [INFO] [stdout] 373 | | self.labels.insert(index, vec![label.clone()]); [INFO] [stdout] 374 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 367 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.labels.entry(index) { [INFO] [stdout] 368 + e.insert(vec![label.clone()]); [INFO] [stdout] 369 + } else { [INFO] [stdout] 370 + self.labels.get_mut(&index).unwrap().push(label.clone()); [INFO] [stdout] 371 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:514:16 [INFO] [stdout] | [INFO] [stdout] 514 | if inst.arguments.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!inst.arguments.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/irgen/instruction.rs:543:25 [INFO] [stdout] | [INFO] [stdout] 543 | / if inst.arguments.len() > 1 [INFO] [stdout] 544 | | { [INFO] [stdout] 545 | | if inst.arguments[1..inst.arguments.len()].contains(&value) [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 543 ~ if inst.arguments.len() > 1 [INFO] [stdout] 544 ~ && inst.arguments[1..inst.arguments.len()].contains(&value) [INFO] [stdout] 545 | { [INFO] [stdout] 546 | reads.push(*index); [INFO] [stdout] 547 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/instruction.rs:591:28 [INFO] [stdout] | [INFO] [stdout] 591 | for (i, (t, n)) in (&self.arguments).iter().enumerate() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.arguments` [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/irgen/instruction.rs:611:51 [INFO] [stdout] | [INFO] [stdout] 611 | if let Some(labels) = self.labels.get(&index) [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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/irgen/instruction.rs:616:54 [INFO] [stdout] | [INFO] [stdout] 616 | if let Some(r) = self.labels.get(&index) [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:627:24 [INFO] [stdout] | [INFO] [stdout] 627 | if next_vec.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_vec.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:439:12 [INFO] [stdout] | [INFO] [stdout] 439 | if self.continue_stack.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.continue_stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:452:12 [INFO] [stdout] | [INFO] [stdout] 452 | if self.break_stack.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.break_stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:469:15 [INFO] [stdout] | [INFO] [stdout] 469 | while fronts.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fronts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:514:16 [INFO] [stdout] | [INFO] [stdout] 514 | if inst.arguments.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!inst.arguments.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:690:15 [INFO] [stdout] | [INFO] [stdout] 690 | while fronts.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fronts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:698:20 [INFO] [stdout] | [INFO] [stdout] 698 | if branches.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `branches.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/irgen/instruction.rs:543:25 [INFO] [stdout] | [INFO] [stdout] 543 | / if inst.arguments.len() > 1 [INFO] [stdout] 544 | | { [INFO] [stdout] 545 | | if inst.arguments[1..inst.arguments.len()].contains(&value) [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 543 ~ if inst.arguments.len() > 1 [INFO] [stdout] 544 ~ && inst.arguments[1..inst.arguments.len()].contains(&value) [INFO] [stdout] 545 | { [INFO] [stdout] 546 | reads.push(*index); [INFO] [stdout] 547 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inst` after checking its variant with `is_none` [INFO] [stdout] --> src/irgen/instruction.rs:768:35 [INFO] [stdout] | [INFO] [stdout] 762 | if inst.is_none() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 768 | writeln!(f, "{}", inst.unwrap())?; [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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/instruction.rs:732:28 [INFO] [stdout] | [INFO] [stdout] 732 | for (i, (t, n)) in (&self.arguments).iter().enumerate() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.arguments` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/instruction.rs:591:28 [INFO] [stdout] | [INFO] [stdout] 591 | for (i, (t, n)) in (&self.arguments).iter().enumerate() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.arguments` [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/irgen/instruction.rs:611:51 [INFO] [stdout] | [INFO] [stdout] 611 | if let Some(labels) = self.labels.get(&index) [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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/irgen/instruction.rs:616:54 [INFO] [stdout] | [INFO] [stdout] 616 | if let Some(r) = self.labels.get(&index) [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:627:24 [INFO] [stdout] | [INFO] [stdout] 627 | if next_vec.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_vec.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:690:15 [INFO] [stdout] | [INFO] [stdout] 690 | while fronts.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fronts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/instruction.rs:698:20 [INFO] [stdout] | [INFO] [stdout] 698 | if branches.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `branches.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inst` after checking its variant with `is_none` [INFO] [stdout] --> src/irgen/instruction.rs:768:35 [INFO] [stdout] | [INFO] [stdout] 762 | if inst.is_none() [INFO] [stdout] | ----------------- help: try: `if let Some() = inst` [INFO] [stdout] ... [INFO] [stdout] 768 | writeln!(f, "{}", inst.unwrap())?; [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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/instruction.rs:732:28 [INFO] [stdout] | [INFO] [stdout] 732 | for (i, (t, n)) in (&self.arguments).iter().enumerate() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.arguments` [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 call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/irgen/expression.rs:83:54 [INFO] [stdout] | [INFO] [stdout] 83 | Some(Value::Literal(Literal::new(i128::from_str_radix(token.data.as_str(), 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `token.data.as_str().parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/irgen/expression.rs:83:54 [INFO] [stdout] | [INFO] [stdout] 83 | Some(Value::Literal(Literal::new(i128::from_str_radix(token.data.as_str(), 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `token.data.as_str().parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:331:113 [INFO] [stdout] | [INFO] [stdout] 331 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), correct_type_references(datatype.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:347:113 [INFO] [stdout] | [INFO] [stdout] 347 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), correct_type_references(datatype.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:388:50 [INFO] [stdout] | [INFO] [stdout] 388 | val0 = attempt_mutate_type(val0, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:389:50 [INFO] [stdout] | [INFO] [stdout] 389 | val1 = attempt_mutate_type(val1, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:454:50 [INFO] [stdout] | [INFO] [stdout] 454 | val0 = attempt_mutate_type(val0, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:455:50 [INFO] [stdout] | [INFO] [stdout] 455 | val1 = attempt_mutate_type(val1, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:331:113 [INFO] [stdout] | [INFO] [stdout] 331 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), correct_type_references(datatype.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:347:113 [INFO] [stdout] | [INFO] [stdout] 347 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), correct_type_references(datatype.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:538:62 [INFO] [stdout] | [INFO] [stdout] 538 | let corrected_type = correct_type_references(datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:540:89 [INFO] [stdout] | [INFO] [stdout] 540 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), corrected_type.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `corrected_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:388:50 [INFO] [stdout] | [INFO] [stdout] 388 | val0 = attempt_mutate_type(val0, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:389:50 [INFO] [stdout] | [INFO] [stdout] 389 | val1 = attempt_mutate_type(val1, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:644:89 [INFO] [stdout] | [INFO] [stdout] 644 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:658:36 [INFO] [stdout] | [INFO] [stdout] 658 | let mut datatype = get_value_type(&val0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `get_value_type(&val0).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:454:50 [INFO] [stdout] | [INFO] [stdout] 454 | val0 = attempt_mutate_type(val0, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:662:89 [INFO] [stdout] | [INFO] [stdout] 662 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:455:50 [INFO] [stdout] | [INFO] [stdout] 455 | val1 = attempt_mutate_type(val1, datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:538:62 [INFO] [stdout] | [INFO] [stdout] 538 | let corrected_type = correct_type_references(datatype.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:540:89 [INFO] [stdout] | [INFO] [stdout] 540 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), corrected_type.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `corrected_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/statement.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | if children.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/statement.rs:100:96 [INFO] [stdout] | [INFO] [stdout] 100 | ... Ok(Statement::new_with_token(StatementType::ContinueStatement, &token)) [INFO] [stdout] | ^^^^^^ help: change this to: `token` [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/irgen/statement.rs:104:93 [INFO] [stdout] | [INFO] [stdout] 104 | ... Ok(Statement::new_with_token(StatementType::BreakStatement, &token)) [INFO] [stdout] | ^^^^^^ help: change this to: `token` [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: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:644:89 [INFO] [stdout] | [INFO] [stdout] 644 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:658:36 [INFO] [stdout] | [INFO] [stdout] 658 | let mut datatype = get_value_type(&val0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `get_value_type(&val0).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/expression.rs:662:89 [INFO] [stdout] | [INFO] [stdout] 662 | let value = Value::Symbol(Symbol::new(func.borrow_mut().get_register(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/statement.rs:224:109 [INFO] [stdout] | [INFO] [stdout] 224 | ... func.borrow_mut().symbol_table.insert(s.clone(), Symbol::new(s.clone(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/irgen/statement.rs:280:44 [INFO] [stdout] | [INFO] [stdout] 280 | compiler_error_loc(format!("Cannot use continue statement outside of loop"), &self.pos)? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot use continue statement outside of loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/irgen/statement.rs:296:44 [INFO] [stdout] | [INFO] [stdout] 296 | compiler_error_loc(format!("Cannot use break statement outside of loop"), &self.pos)? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot use break statement outside of loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/statement.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | if children.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/statement.rs:100:96 [INFO] [stdout] | [INFO] [stdout] 100 | ... Ok(Statement::new_with_token(StatementType::ContinueStatement, &token)) [INFO] [stdout] | ^^^^^^ help: change this to: `token` [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/irgen/statement.rs:104:93 [INFO] [stdout] | [INFO] [stdout] 104 | ... Ok(Statement::new_with_token(StatementType::BreakStatement, &token)) [INFO] [stdout] | ^^^^^^ help: change this to: `token` [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: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:17:27 [INFO] [stdout] | [INFO] [stdout] 17 | let mut lit = literal.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:37:27 [INFO] [stdout] | [INFO] [stdout] 37 | let mut lit = literal.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:85:22 [INFO] [stdout] | [INFO] [stdout] 85 | let mut result = datatype.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/irgen/utils.rs:145:16 [INFO] [stdout] | [INFO] [stdout] 145 | Ok(String::from(token.data)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `token.data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/statement.rs:224:109 [INFO] [stdout] | [INFO] [stdout] 224 | ... func.borrow_mut().symbol_table.insert(s.clone(), Symbol::new(s.clone(), datatype.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/irgen/statement.rs:280:44 [INFO] [stdout] | [INFO] [stdout] 280 | compiler_error_loc(format!("Cannot use continue statement outside of loop"), &self.pos)? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot use continue statement outside of loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/irgen/statement.rs:296:44 [INFO] [stdout] | [INFO] [stdout] 296 | compiler_error_loc(format!("Cannot use break statement outside of loop"), &self.pos)? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot use break statement outside of loop".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | for (index, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:151:26 [INFO] [stdout] | [INFO] [stdout] 151 | for (index, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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: needlessly taken reference of both operands [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:200:20 [INFO] [stdout] | [INFO] [stdout] 200 | if &vs[0] == &vs[1] [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 200 - if &vs[0] == &vs[1] [INFO] [stdout] 200 + if vs[0] == vs[1] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:220:22 [INFO] [stdout] | [INFO] [stdout] 220 | for (_, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:17:27 [INFO] [stdout] | [INFO] [stdout] 17 | let mut lit = literal.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:37:27 [INFO] [stdout] | [INFO] [stdout] 37 | let mut lit = literal.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:292:60 [INFO] [stdout] | [INFO] [stdout] 292 | if func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `symbol.datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:308:39 [INFO] [stdout] | [INFO] [stdout] 308 | let mut val = lit.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `lit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:320:63 [INFO] [stdout] | [INFO] [stdout] 320 | ... for arg in &func.instructions.get(&index).unwrap().arguments [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:324:71 [INFO] [stdout] | [INFO] [stdout] 324 | ... new_arguments.push(Value::Literal(val.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:332:55 [INFO] [stdout] | [INFO] [stdout] 332 | ... func.instructions.get_mut(&index).unwrap().arguments = new_arguments; [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/utils.rs:85:22 [INFO] [stdout] | [INFO] [stdout] 85 | let mut result = datatype.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/irgen/utils.rs:145:16 [INFO] [stdout] | [INFO] [stdout] 145 | Ok(String::from(token.data)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `token.data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:362:9 [INFO] [stdout] | [INFO] [stdout] 362 | / if writes.len() == 1 [INFO] [stdout] 363 | | { [INFO] [stdout] 364 | | if !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] ... | [INFO] [stdout] 475 | | } [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] 362 ~ if writes.len() == 1 [INFO] [stdout] 363 ~ && !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] 364 | { [INFO] [stdout] ... [INFO] [stdout] 472 | } [INFO] [stdout] 473 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:364:65 [INFO] [stdout] | [INFO] [stdout] 364 | if !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `symbol.datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | for (index, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:389:75 [INFO] [stdout] | [INFO] [stdout] 389 | ... new_arguments.push(Value::Literal(val.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:151:26 [INFO] [stdout] | [INFO] [stdout] 151 | for (index, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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: called `unwrap` on `result_branch` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:591:44 [INFO] [stdout] | [INFO] [stdout] 583 | if result_branch.is_some() && read_inst.opcode == OpCode::Bne [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 591 | read_inst.opcode = result_branch.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: needlessly taken reference of both operands [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:200:20 [INFO] [stdout] | [INFO] [stdout] 200 | if &vs[0] == &vs[1] [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 200 - if &vs[0] == &vs[1] [INFO] [stdout] 200 + if vs[0] == vs[1] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:220:22 [INFO] [stdout] | [INFO] [stdout] 220 | for (_, inst) in (&func.instructions).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `func.instructions` [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: length comparison to zero [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:634:12 [INFO] [stdout] | [INFO] [stdout] 634 | if current.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:649:48 [INFO] [stdout] | [INFO] [stdout] 649 | if current_domain.contains(&d) [INFO] [stdout] | ^^ help: change this to: `d` [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: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:292:60 [INFO] [stdout] | [INFO] [stdout] 292 | if func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `symbol.datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:683:12 [INFO] [stdout] | [INFO] [stdout] 683 | if set.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:308:39 [INFO] [stdout] | [INFO] [stdout] 308 | let mut val = lit.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `lit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:320:63 [INFO] [stdout] | [INFO] [stdout] 320 | ... for arg in &func.instructions.get(&index).unwrap().arguments [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:324:71 [INFO] [stdout] | [INFO] [stdout] 324 | ... new_arguments.push(Value::Literal(val.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:332:55 [INFO] [stdout] | [INFO] [stdout] 332 | ... func.instructions.get_mut(&index).unwrap().arguments = new_arguments; [INFO] [stdout] | ^^^^^^ help: change this to: `index` [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 `if` statement can be collapsed [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:362:9 [INFO] [stdout] | [INFO] [stdout] 362 | / if writes.len() == 1 [INFO] [stdout] 363 | | { [INFO] [stdout] 364 | | if !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] ... | [INFO] [stdout] 475 | | } [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] 362 ~ if writes.len() == 1 [INFO] [stdout] 363 ~ && !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] 364 | { [INFO] [stdout] ... [INFO] [stdout] 472 | } [INFO] [stdout] 473 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:364:65 [INFO] [stdout] | [INFO] [stdout] 364 | if !func.arguments.contains(&(symbol.title.clone(), symbol.datatype.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `symbol.datatype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Literal` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:389:75 [INFO] [stdout] | [INFO] [stdout] 389 | ... new_arguments.push(Value::Literal(val.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/typecorrect.rs:72:45 [INFO] [stdout] | [INFO] [stdout] 72 | ... symb.datatype = symbol_map.get(&symb.title).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*symbol_map.get(&symb.title).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result_branch` after checking its variant with `is_some` [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:591:44 [INFO] [stdout] | [INFO] [stdout] 583 | if result_branch.is_some() && read_inst.opcode == OpCode::Bne [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 591 | read_inst.opcode = result_branch.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/irgen/errors.rs:15:19 [INFO] [stdout] | [INFO] [stdout] 15 | let got_str = raw_got_str.split("(").nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `raw_got_str.split("(").next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/irgen/errors.rs:26:38 [INFO] [stdout] | [INFO] [stdout] 26 | Some(l) => Err(Error::error(&format!("Compilation Error: {}", format!("{} at {}", text, l)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:634:12 [INFO] [stdout] | [INFO] [stdout] 634 | if current.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:649:48 [INFO] [stdout] | [INFO] [stdout] 649 | if current_domain.contains(&d) [INFO] [stdout] | ^^ help: change this to: `d` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/irgen/types.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / match self.raw_type [INFO] [stdout] 52 | | { [INFO] [stdout] 53 | | NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64 => true, [INFO] [stdout] 54 | | _ => false [INFO] [stdout] 55 | | } [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] 51 - match self.raw_type [INFO] [stdout] 52 - { [INFO] [stdout] 53 - NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64 => true, [INFO] [stdout] 54 - _ => false [INFO] [stdout] 55 - } [INFO] [stdout] 51 + matches!(self.raw_type, NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/irgen/optimize/optimizations.rs:683:12 [INFO] [stdout] | [INFO] [stdout] 683 | if set.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/avrasm/generation.rs:32:24 [INFO] [stdout] | [INFO] [stdout] 32 | result += &format!("{}", context.render_function()?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `context.render_function()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/avrasm/functions.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if self.free_registers.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.free_registers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/avrasm/functions.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if self.free_registers.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.free_registers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/codegen/avrasm/functions.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | if self.free_registers[i] % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.free_registers[i].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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:86:16 [INFO] [stdout] | [INFO] [stdout] 86 | Ok(self.symbol_map.get(&symb.title).unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.symbol_map.get(&symb.title).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:95:60 [INFO] [stdout] | [INFO] [stdout] 95 | self.symbol_map.insert(symb.title.clone(), reg.clone()); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `reg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:104:60 [INFO] [stdout] | [INFO] [stdout] 104 | self.symbol_map.insert(symb.title.clone(), reg.clone()); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `reg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/irgen/optimize/typecorrect.rs:72:45 [INFO] [stdout] | [INFO] [stdout] 72 | ... symb.datatype = symbol_map.get(&symb.title).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*symbol_map.get(&symb.title).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/irgen/errors.rs:15:19 [INFO] [stdout] | [INFO] [stdout] 15 | let got_str = raw_got_str.split("(").nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `raw_got_str.split("(").next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/irgen/errors.rs:26:38 [INFO] [stdout] | [INFO] [stdout] 26 | Some(l) => Err(Error::error(&format!("Compilation Error: {}", format!("{} at {}", text, l)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/irgen/types.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / match self.raw_type [INFO] [stdout] 52 | | { [INFO] [stdout] 53 | | NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64 => true, [INFO] [stdout] 54 | | _ => false [INFO] [stdout] 55 | | } [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] 51 - match self.raw_type [INFO] [stdout] 52 - { [INFO] [stdout] 53 - NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64 => true, [INFO] [stdout] 54 - _ => false [INFO] [stdout] 55 - } [INFO] [stdout] 51 + matches!(self.raw_type, NonPtrType::I8 | NonPtrType::I16 | NonPtrType::I32 | NonPtrType::I64) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/avrasm/generation.rs:32:24 [INFO] [stdout] | [INFO] [stdout] 32 | result += &format!("{}", context.render_function()?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `context.render_function()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/avrasm/functions.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if self.free_registers.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.free_registers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/avrasm/functions.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if self.free_registers.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.free_registers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/codegen/avrasm/functions.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | if self.free_registers[i] % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.free_registers[i].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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:86:16 [INFO] [stdout] | [INFO] [stdout] 86 | Ok(self.symbol_map.get(&symb.title).unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.symbol_map.get(&symb.title).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:95:60 [INFO] [stdout] | [INFO] [stdout] 95 | self.symbol_map.insert(symb.title.clone(), reg.clone()); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `reg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/avrasm/functions.rs:104:60 [INFO] [stdout] | [INFO] [stdout] 104 | self.symbol_map.insert(symb.title.clone(), reg.clone()); [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `reg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen/avrasm/functions.rs:439:31 [INFO] [stdout] | [INFO] [stdout] 439 | self.get_register(&symb)? [INFO] [stdout] | ^^^^^ help: change this to: `symb` [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/avrasm/functions.rs:472:106 [INFO] [stdout] | [INFO] [stdout] 472 | result += &generate_command(&format!("add r{}, r{}", dest_reg, self.get_register(&symb1)?))?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/avrasm/functions.rs:475:114 [INFO] [stdout] | [INFO] [stdout] 475 | ... result += &generate_command(&format!("adc r{}, r{}", dest_reg + 1, self.get_register(&symb1)? + 1))?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/avrasm/functions.rs:535:42 [INFO] [stdout] | [INFO] [stdout] 535 | let reg0 = self.get_register(&symb0)?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb0` [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/avrasm/functions.rs:545:50 [INFO] [stdout] | [INFO] [stdout] 545 | let reg1 = self.get_register(&symb1)?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/avrasm/functions.rs:439:31 [INFO] [stdout] | [INFO] [stdout] 439 | self.get_register(&symb)? [INFO] [stdout] | ^^^^^ help: change this to: `symb` [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: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/llvm/functions.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let mut datatype = self.get_datatype().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.get_datatype()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen/avrasm/functions.rs:472:106 [INFO] [stdout] | [INFO] [stdout] 472 | result += &generate_command(&format!("add r{}, r{}", dest_reg, self.get_register(&symb1)?))?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/avrasm/functions.rs:475:114 [INFO] [stdout] | [INFO] [stdout] 475 | ... result += &generate_command(&format!("adc r{}, r{}", dest_reg + 1, self.get_register(&symb1)? + 1))?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/llvm/functions.rs:160:17 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", convert_to_llvm(&dt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `convert_to_llvm(&dt).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/codegen/avrasm/functions.rs:535:42 [INFO] [stdout] | [INFO] [stdout] 535 | let reg0 = self.get_register(&symb0)?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb0` [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/avrasm/functions.rs:545:50 [INFO] [stdout] | [INFO] [stdout] 545 | let reg1 = self.get_register(&symb1)?; [INFO] [stdout] | ^^^^^^ help: change this to: `symb1` [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/llvm/functions.rs:210:25 [INFO] [stdout] | [INFO] [stdout] 210 | format!("{}", convert_to_llvm(&literal.datatype)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `convert_to_llvm(&literal.datatype).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/functions.rs:214:25 [INFO] [stdout] | [INFO] [stdout] 214 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&Vec>` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/llvm/functions.rs:338:43 [INFO] [stdout] | [INFO] [stdout] 338 | let labels = if let Some(l) = func.labels.get(&i).clone() {l.clone()} else {vec![]}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `func.labels.get(&i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DataType` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/llvm/functions.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let mut datatype = self.get_datatype().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.get_datatype()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/functions.rs:160:17 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", convert_to_llvm(&dt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `convert_to_llvm(&dt).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/functions.rs:210:25 [INFO] [stdout] | [INFO] [stdout] 210 | format!("{}", convert_to_llvm(&literal.datatype)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `convert_to_llvm(&literal.datatype).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/functions.rs:214:25 [INFO] [stdout] | [INFO] [stdout] 214 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&Vec>` which implements the `Copy` trait [INFO] [stdout] --> src/codegen/llvm/functions.rs:338:43 [INFO] [stdout] | [INFO] [stdout] 338 | let labels = if let Some(l) = func.labels.get(&i).clone() {l.clone()} else {vec![]}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `func.labels.get(&i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/llvm/functions.rs:662:32 [INFO] [stdout] | [INFO] [stdout] 662 | ... if self.current_arguments.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.current_arguments.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/generation.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | result += &format!("{}", context.render_function()?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `context.render_function()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LLVM` contains a capitalized acronym [INFO] [stdout] --> src/codegen/mod.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | LLVM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Llvm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/mod.rs:75:26 [INFO] [stdout] | [INFO] [stdout] 75 | result = format!("{}", avrasm::AvrAsmGenerator::new(self.functions.clone()).render()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `avrasm::AvrAsmGenerator::new(self.functions.clone()).render()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/codegen/mod.rs:80:30 [INFO] [stdout] | [INFO] [stdout] 80 | let target = if let Some(args) = self.options.map.get("--llvm-target") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 81 | | { [INFO] [stdout] 82 | | Some(args[0].as_str()) [INFO] [stdout] ... | [INFO] [stdout] 86 | | None [INFO] [stdout] 87 | | }; [INFO] [stdout] | |_________________^ help: try: `self.options.map.get("--llvm-target").map(|args| args[0].as_str())` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/codegen/mod.rs:90:30 [INFO] [stdout] | [INFO] [stdout] 90 | let layout = if let Some(args) = self.options.map.get("--llvm-layout") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 91 | | { [INFO] [stdout] 92 | | Some(args[0].as_str()) [INFO] [stdout] ... | [INFO] [stdout] 96 | | None [INFO] [stdout] 97 | | }; [INFO] [stdout] | |_________________^ help: try: `self.options.map.get("--llvm-layout").map(|args| args[0].as_str())` [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: useless use of `format!` [INFO] [stdout] --> src/codegen/mod.rs:100:26 [INFO] [stdout] | [INFO] [stdout] 100 | result = format!("{}", llvm::LLVMGenerator::new(self.functions.clone()).render(target, layout)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `llvm::LLVMGenerator::new(self.functions.clone()).render(target, layout)?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/tokenizer/tokenize.rs:120:36 [INFO] [stdout] | [INFO] [stdout] 120 | ... if vec!['<', '>'].contains(¤t.0) && tokenizer.source.check_next('=') [INFO] [stdout] | ^^^^^^^^^^^^^^ help: you can use an array directly: `['<', '>']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:265:38 [INFO] [stdout] | [INFO] [stdout] 265 | child.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 265 - child.render(func.clone())?; [INFO] [stdout] 265 + child.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:306:30 [INFO] [stdout] | [INFO] [stdout] 306 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 306 - e.render(func.clone())?; [INFO] [stdout] 306 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:324:30 [INFO] [stdout] | [INFO] [stdout] 324 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 324 - e.render(func.clone())?; [INFO] [stdout] 324 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:362:30 [INFO] [stdout] | [INFO] [stdout] 362 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 362 - e.render(func.clone())?; [INFO] [stdout] 362 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:396:30 [INFO] [stdout] | [INFO] [stdout] 396 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 396 - e.render(func.clone())?; [INFO] [stdout] 396 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:433:30 [INFO] [stdout] | [INFO] [stdout] 433 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 433 - e.render(func.clone())?; [INFO] [stdout] 433 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:447:55 [INFO] [stdout] | [INFO] [stdout] 447 | self.expr.clone().unwrap().render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 447 - self.expr.clone().unwrap().render(func.clone())?; [INFO] [stdout] 447 + self.expr.clone().unwrap().render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/codegen/llvm/functions.rs:662:32 [INFO] [stdout] | [INFO] [stdout] 662 | ... if self.current_arguments.len() > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.current_arguments.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/llvm/generation.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | result += &format!("{}", context.render_function()?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `context.render_function()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LLVM` contains a capitalized acronym [INFO] [stdout] --> src/codegen/mod.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | LLVM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Llvm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/codegen/mod.rs:75:26 [INFO] [stdout] | [INFO] [stdout] 75 | result = format!("{}", avrasm::AvrAsmGenerator::new(self.functions.clone()).render()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `avrasm::AvrAsmGenerator::new(self.functions.clone()).render()?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/codegen/mod.rs:80:30 [INFO] [stdout] | [INFO] [stdout] 80 | let target = if let Some(args) = self.options.map.get("--llvm-target") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 81 | | { [INFO] [stdout] 82 | | Some(args[0].as_str()) [INFO] [stdout] ... | [INFO] [stdout] 86 | | None [INFO] [stdout] 87 | | }; [INFO] [stdout] | |_________________^ help: try: `self.options.map.get("--llvm-target").map(|args| args[0].as_str())` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/codegen/mod.rs:90:30 [INFO] [stdout] | [INFO] [stdout] 90 | let layout = if let Some(args) = self.options.map.get("--llvm-layout") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 91 | | { [INFO] [stdout] 92 | | Some(args[0].as_str()) [INFO] [stdout] ... | [INFO] [stdout] 96 | | None [INFO] [stdout] 97 | | }; [INFO] [stdout] | |_________________^ help: try: `self.options.map.get("--llvm-layout").map(|args| args[0].as_str())` [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: useless use of `format!` [INFO] [stdout] --> src/codegen/mod.rs:100:26 [INFO] [stdout] | [INFO] [stdout] 100 | result = format!("{}", llvm::LLVMGenerator::new(self.functions.clone()).render(target, layout)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `llvm::LLVMGenerator::new(self.functions.clone()).render(target, layout)?.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/tokenizer/tokenize.rs:120:36 [INFO] [stdout] | [INFO] [stdout] 120 | ... if vec!['<', '>'].contains(¤t.0) && tokenizer.source.check_next('=') [INFO] [stdout] | ^^^^^^^^^^^^^^ help: you can use an array directly: `['<', '>']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:265:38 [INFO] [stdout] | [INFO] [stdout] 265 | child.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 265 - child.render(func.clone())?; [INFO] [stdout] 265 + child.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:306:30 [INFO] [stdout] | [INFO] [stdout] 306 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 306 - e.render(func.clone())?; [INFO] [stdout] 306 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:324:30 [INFO] [stdout] | [INFO] [stdout] 324 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 324 - e.render(func.clone())?; [INFO] [stdout] 324 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:362:30 [INFO] [stdout] | [INFO] [stdout] 362 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 362 - e.render(func.clone())?; [INFO] [stdout] 362 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:396:30 [INFO] [stdout] | [INFO] [stdout] 396 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 396 - e.render(func.clone())?; [INFO] [stdout] 396 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:433:30 [INFO] [stdout] | [INFO] [stdout] 433 | e.render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 433 - e.render(func.clone())?; [INFO] [stdout] 433 + e.render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/irgen/statement.rs:447:55 [INFO] [stdout] | [INFO] [stdout] 447 | self.expr.clone().unwrap().render(func.clone())?; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::cell::RefCell<&mut irgen::instruction::Function>` does not implement `Clone`, so calling `clone` on `&std::cell::RefCell<&mut irgen::instruction::Function>` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 447 - self.expr.clone().unwrap().render(func.clone())?; [INFO] [stdout] 447 + self.expr.clone().unwrap().render(func)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.05s [INFO] running `Command { std: "docker" "inspect" "5438c27163d17b610e0adab2eae8261d9fc4c8aefce49aa2e27512743127096f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5438c27163d17b610e0adab2eae8261d9fc4c8aefce49aa2e27512743127096f", kill_on_drop: false }` [INFO] [stdout] 5438c27163d17b610e0adab2eae8261d9fc4c8aefce49aa2e27512743127096f