[INFO] cloning repository https://github.com/puppyofkosh/safer-c-compiler [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/puppyofkosh/safer-c-compiler" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpuppyofkosh%2Fsafer-c-compiler", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpuppyofkosh%2Fsafer-c-compiler'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 9a53e4b6c2ca2756fb91fbade4407e64796adfed [INFO] linting puppyofkosh/safer-c-compiler against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpuppyofkosh%2Fsafer-c-compiler" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/puppyofkosh/safer-c-compiler [INFO] finished tweaking git repo https://github.com/puppyofkosh/safer-c-compiler [INFO] tweaked toml for git repo https://github.com/puppyofkosh/safer-c-compiler written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/puppyofkosh/safer-c-compiler 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/puppyofkosh/safer-c-compiler 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] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 7de96bc2370ae1f78cfba879da0b1b2c9b3c99ce3bea1af39beb8138230883f0 [INFO] running `Command { std: "docker" "start" "-a" "7de96bc2370ae1f78cfba879da0b1b2c9b3c99ce3bea1af39beb8138230883f0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7de96bc2370ae1f78cfba879da0b1b2c9b3c99ce3bea1af39beb8138230883f0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7de96bc2370ae1f78cfba879da0b1b2c9b3c99ce3bea1af39beb8138230883f0", kill_on_drop: false }` [INFO] [stdout] 7de96bc2370ae1f78cfba879da0b1b2c9b3c99ce3bea1af39beb8138230883f0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 0c3eb252ba4664d831b97958b79538d297b8221ec0ea819ed807a26a6732341c [INFO] running `Command { std: "docker" "start" "-a" "0c3eb252ba4664d831b97958b79538d297b8221ec0ea819ed807a26a6732341c", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking safer-c-compiler v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: anonymous parameters are deprecated and will be removed in the next edition [INFO] [stdout] --> src/code_generator.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | fn generate_code(&mut self, &Program) -> String; [INFO] [stdout] | ^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: &Program` [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:417:41 [INFO] [stdout] | [INFO] [stdout] 417 | FunctionCall {name:fn_name, args_exprs: args_exprs } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `args_exprs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:445:26 [INFO] [stdout] | [INFO] [stdout] 445 | statements: statements, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `statements` [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/parser.rs:446:26 [INFO] [stdout] | [INFO] [stdout] 446 | args: args, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `args` [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/parser.rs:448:30 [INFO] [stdout] | [INFO] [stdout] 448 | ... arg_types: arg_types, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `arg_types` [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/parser.rs:449:30 [INFO] [stdout] | [INFO] [stdout] 449 | ... return_type: return_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `return_type` [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/parser.rs:474:13 [INFO] [stdout] | [INFO] [stdout] 474 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/parser.rs:513:31 [INFO] [stdout] | [INFO] [stdout] 513 | return Block {statements: statements}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `statements` [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/parser.rs:536:22 [INFO] [stdout] | [INFO] [stdout] 536 | ast::Program{functions: functions, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `functions` [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/parser.rs:537:22 [INFO] [stdout] | [INFO] [stdout] 537 | structs: structs} [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `structs` [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: unused import: `ast::Block` [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use ast::Block; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/representation_manager.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | offset: offset, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `offset` [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/representation_manager.rs:52:31 [INFO] [stdout] | [INFO] [stdout] 52 | StructRepresentation{ field_to_info: field_to_info, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `field_to_info` [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: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:29 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:42 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/x86_code_generator.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | var_type: var_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `var_type` [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/x86_code_generator.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | machine_type: machine_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `machine_type` [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: use of deprecated macro `try`: use the `?` operator instead [INFO] [stdout] --> src/main.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | try!(f.read_to_string(&mut s)); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated macro `try`: use the `?` operator instead [INFO] [stdout] --> src/main.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | let mut f = try!(File::open(name)); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string() [INFO] [stdout] --> src/main.rs:44:35 [INFO] [stdout] | [INFO] [stdout] 44 | ... Error::description(&why)), [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string() [INFO] [stdout] --> src/main.rs:51:27 [INFO] [stdout] | [INFO] [stdout] 51 | Error::description(&why)) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: anonymous parameters are deprecated and will be removed in the next edition [INFO] [stdout] --> src/code_generator.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | fn generate_code(&mut self, &Program) -> String; [INFO] [stdout] | ^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: &Program` [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:417:41 [INFO] [stdout] | [INFO] [stdout] 417 | FunctionCall {name:fn_name, args_exprs: args_exprs } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `args_exprs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:445:26 [INFO] [stdout] | [INFO] [stdout] 445 | statements: statements, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `statements` [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/parser.rs:446:26 [INFO] [stdout] | [INFO] [stdout] 446 | args: args, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `args` [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/parser.rs:448:30 [INFO] [stdout] | [INFO] [stdout] 448 | ... arg_types: arg_types, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `arg_types` [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/parser.rs:449:30 [INFO] [stdout] | [INFO] [stdout] 449 | ... return_type: return_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `return_type` [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/parser.rs:474:13 [INFO] [stdout] | [INFO] [stdout] 474 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/parser.rs:513:31 [INFO] [stdout] | [INFO] [stdout] 513 | return Block {statements: statements}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `statements` [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/parser.rs:536:22 [INFO] [stdout] | [INFO] [stdout] 536 | ast::Program{functions: functions, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `functions` [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/parser.rs:537:22 [INFO] [stdout] | [INFO] [stdout] 537 | structs: structs} [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `structs` [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: unused import: `ast::Block` [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use ast::Block; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/representation_manager.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | offset: offset, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `offset` [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/representation_manager.rs:52:31 [INFO] [stdout] | [INFO] [stdout] 52 | StructRepresentation{ field_to_info: field_to_info, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `field_to_info` [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: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:29 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/scanner.rs:157:42 [INFO] [stdout] | [INFO] [stdout] 157 | 'a'...'z' | 'A' ... 'Z' | '0'...'9' => { [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/x86_code_generator.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | var_type: var_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `var_type` [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/x86_code_generator.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | machine_type: machine_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `machine_type` [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: use of deprecated macro `try`: use the `?` operator instead [INFO] [stdout] --> src/main.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | try!(f.read_to_string(&mut s)); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated macro `try`: use the `?` operator instead [INFO] [stdout] --> src/main.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | let mut f = try!(File::open(name)); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string() [INFO] [stdout] --> src/main.rs:44:35 [INFO] [stdout] | [INFO] [stdout] 44 | ... Error::description(&why)), [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string() [INFO] [stdout] --> src/main.rs:51:27 [INFO] [stdout] | [INFO] [stdout] 51 | Error::description(&why)) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/x86_code_generator.rs:390:25 [INFO] [stdout] | [INFO] [stdout] 390 | let mut current_block = self.blocks.last_mut().unwrap(); [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `typ` is never read [INFO] [stdout] --> src/representation_manager.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct FieldInfo { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 11 | pub typ: VarType, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `var_type` is never read [INFO] [stdout] --> src/x86_code_generator.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 38 | struct LocalVariable { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 42 | var_type: VarType, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LocalVariable` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EAX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eax` [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: name `EBX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:10 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ECX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:15 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ecx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | ESP, EBP [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Esp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:5:10 [INFO] [stdout] | [INFO] [stdout] 5 | ESP, EBP [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NOP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | NOP, // No-op. Do nothing [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/assembly_printer.rs:28:48 [INFO] [stdout] | [INFO] [stdout] 28 | VariableStatic(n) => "$".to_string() + &n.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/assembly_printer.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | s.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/assembly_printer.rs:70:46 [INFO] [stdout] | [INFO] [stdout] 70 | pub fn instruction_list_to_asm(instructions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 70 - pub fn instruction_list_to_asm(instructions: &Vec) -> String { [INFO] [stdout] 70 + pub fn instruction_list_to_asm(instructions: &[Instruction]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/ast_helper.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Pointer(_, _) = *typ { [INFO] [stdout] 8 | | true [INFO] [stdout] 9 | | } else { [INFO] [stdout] 10 | | false [INFO] [stdout] 11 | | } [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] 7 - if let Pointer(_, _) = *typ { [INFO] [stdout] 8 - true [INFO] [stdout] 9 - } else { [INFO] [stdout] 10 - false [INFO] [stdout] 11 - } [INFO] [stdout] 7 + matches!(*typ, Pointer(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:108:43 [INFO] [stdout] | [INFO] [stdout] 108 | Expression::BinaryOp(optype_to_op(&op), [INFO] [stdout] | ^^^ help: change this to: `op` [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: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:332:9 [INFO] [stdout] | [INFO] [stdout] 332 | return Statement::Return(expr); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 332 - return Statement::Return(expr); [INFO] [stdout] 332 + Statement::Return(expr) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:444:9 [INFO] [stdout] | [INFO] [stdout] 444 | / return Function {name: fn_name, [INFO] [stdout] 445 | | statements: statements, [INFO] [stdout] 446 | | args: args, [INFO] [stdout] 447 | | fn_type: ast::FunctionType { [INFO] [stdout] ... | [INFO] [stdout] 452 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 444 ~ Function {name: fn_name, [INFO] [stdout] 445 + statements: statements, [INFO] [stdout] 446 + args: args, [INFO] [stdout] 447 + fn_type: ast::FunctionType { [INFO] [stdout] 448 + arg_types: arg_types, [INFO] [stdout] 449 + return_type: return_type, [INFO] [stdout] 450 + is_var_args: false, [INFO] [stdout] 451 + } [INFO] [stdout] 452 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/x86_code_generator.rs:390:25 [INFO] [stdout] | [INFO] [stdout] 390 | let mut current_block = self.blocks.last_mut().unwrap(); [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:546:5 [INFO] [stdout] | [INFO] [stdout] 544 | let prog = p.parse_program(tokens); [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 545 | [INFO] [stdout] 546 | prog [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 544 ~ [INFO] [stdout] 545 | [INFO] [stdout] 546 ~ p.parse_program(tokens) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BinaryOp` which implements the `Copy` trait [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:93:38 [INFO] [stdout] | [INFO] [stdout] 93 | Expression::BinaryOp(op.clone(), Box::new(left), [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `op` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(expr) = value_expr { [INFO] [stdout] 145 | | Some(self.transform_expr(expr)) [INFO] [stdout] 146 | | } else { [INFO] [stdout] 147 | | None [INFO] [stdout] 148 | | }; [INFO] [stdout] | |_________________^ help: try: `value_expr.map(|expr| self.transform_expr(expr))` [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: unneeded `return` statement [INFO] [stdout] --> src/representation_manager.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | return n; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 113 - return n; [INFO] [stdout] 113 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/representation_manager.rs:112:12 [INFO] [stdout] | [INFO] [stdout] 112 | if let &VarType::Struct(ref n) = typ { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 112 - if let &VarType::Struct(ref n) = typ { [INFO] [stdout] 112 + if let VarType::Struct(n) = typ { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `typ` is never read [INFO] [stdout] --> src/representation_manager.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct FieldInfo { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 11 | pub typ: VarType, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `var_type` is never read [INFO] [stdout] --> src/x86_code_generator.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 38 | struct LocalVariable { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 42 | var_type: VarType, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LocalVariable` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scanner.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | assert!(token.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!token.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: name `EAX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eax` [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: name `EBX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:10 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ECX` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:3:15 [INFO] [stdout] | [INFO] [stdout] 3 | EAX, EBX, ECX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ecx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | ESP, EBP [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Esp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:5:10 [INFO] [stdout] | [INFO] [stdout] 5 | ESP, EBP [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scanner.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | if source.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `source.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` can be collapsed into the outer `match` [INFO] [stdout] --> src/scanner.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | / if next_char == Some('=') { [INFO] [stdout] 142 | | // We should append the '=' since '>=' is a single token [INFO] [stdout] 143 | | s.push(chars.pop_front().unwrap()); [INFO] [stdout] 144 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 140 ~ '>' | '<' | '=' | '!' [INFO] [stdout] 141 ~ if next_char == Some('=') => { [INFO] [stdout] 142 | // We should append the '=' since '>=' is a single token [INFO] [stdout] 143 | s.push(chars.pop_front().unwrap()); [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NOP` contains a capitalized acronym [INFO] [stdout] --> src/assembly.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | NOP, // No-op. Do nothing [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/assembly_printer.rs:28:48 [INFO] [stdout] | [INFO] [stdout] 28 | VariableStatic(n) => "$".to_string() + &n.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(struct_name).is_some()` [INFO] [stdout] --> src/type_checker.rs:105:43 [INFO] [stdout] | [INFO] [stdout] 105 | self.struct_to_definition.get(struct_name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(struct_name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/type_checker.rs:138:13 [INFO] [stdout] | [INFO] [stdout] 138 | if arg_type_opt.is_none() { return None; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `arg_type_opt.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/assembly_printer.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | s.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/assembly_printer.rs:70:46 [INFO] [stdout] | [INFO] [stdout] 70 | pub fn instruction_list_to_asm(instructions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 70 - pub fn instruction_list_to_asm(instructions: &Vec) -> String { [INFO] [stdout] 70 + pub fn instruction_list_to_asm(instructions: &[Instruction]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/type_checker.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | assert_eq!(fn_type.is_var_args, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 152 - assert_eq!(fn_type.is_var_args, true); [INFO] [stdout] 152 + assert!(fn_type.is_var_args); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/type_checker.rs:162:12 [INFO] [stdout] | [INFO] [stdout] 162 | if res == None { [INFO] [stdout] | ^^^^^^^^^^^ help: use `Option::is_none()` instead: `res.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/type_checker.rs:223:37 [INFO] [stdout] | [INFO] [stdout] 223 | Expression::Value(v) if v >= 0 && v < 256 => Some(Char), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..256).contains(&v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/type_checker.rs:254:29 [INFO] [stdout] | [INFO] [stdout] 254 | if let Some(&VarType::Pointer(_, ref typ)) = typ_opt.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 254 - if let Some(&VarType::Pointer(_, ref typ)) = typ_opt.as_ref() { [INFO] [stdout] 254 + if let Some(VarType::Pointer(_, typ)) = typ_opt.as_ref() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/type_checker.rs:273:26 [INFO] [stdout] | [INFO] [stdout] 273 | .expect(&format!("Struct {} unkown!", struct_name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Struct {} unkown!", struct_name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/type_checker.rs:363:20 [INFO] [stdout] | [INFO] [stdout] 363 | if res == true { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `res` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/ast_helper.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Pointer(_, _) = *typ { [INFO] [stdout] 8 | | true [INFO] [stdout] 9 | | } else { [INFO] [stdout] 10 | | false [INFO] [stdout] 11 | | } [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] 7 - if let Pointer(_, _) = *typ { [INFO] [stdout] 8 - true [INFO] [stdout] 9 - } else { [INFO] [stdout] 10 - false [INFO] [stdout] 11 - } [INFO] [stdout] 7 + matches!(*typ, Pointer(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/type_checker_helper.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | return is_pointer(&l) && is_pointer(&r); [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:16:45 [INFO] [stdout] | [INFO] [stdout] 16 | return is_pointer(&l) && is_pointer(&r); [INFO] [stdout] | ^^ help: change this to: `r` [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: unneeded `return` statement [INFO] [stdout] --> src/type_checker_helper.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return false; [INFO] [stdout] 33 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/type_checker_helper.rs:29:28 [INFO] [stdout] | [INFO] [stdout] 29 | return (is_pointer(&l) && type_contains(&Int, &r)) || [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:29:55 [INFO] [stdout] | [INFO] [stdout] 29 | return (is_pointer(&l) && type_contains(&Int, &r)) || [INFO] [stdout] | ^^ help: change this to: `r` [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/type_checker_helper.rs:30:34 [INFO] [stdout] | [INFO] [stdout] 30 | (type_contains(&Int, &l) && is_pointer(&r)); [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:30:52 [INFO] [stdout] | [INFO] [stdout] 30 | (type_contains(&Int, &l) && is_pointer(&r)); [INFO] [stdout] | ^^ help: change this to: `r` [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/parser.rs:108:43 [INFO] [stdout] | [INFO] [stdout] 108 | Expression::BinaryOp(optype_to_op(&op), [INFO] [stdout] | ^^^ help: change this to: `op` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/type_checker_helper.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / match expr_node.expr { [INFO] [stdout] 40 | | Expression::Variable(_) => true, [INFO] [stdout] 41 | | Expression::Dereference(_) => true, [INFO] [stdout] 42 | | Expression::FieldAccess(_,_) => true, [INFO] [stdout] 43 | | _ => false [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 39 - match expr_node.expr { [INFO] [stdout] 40 - Expression::Variable(_) => true, [INFO] [stdout] 41 - Expression::Dereference(_) => true, [INFO] [stdout] 42 - Expression::FieldAccess(_,_) => true, [INFO] [stdout] 43 - _ => false [INFO] [stdout] 44 - } [INFO] [stdout] 39 + matches!(expr_node.expr, Expression::Variable(_) | Expression::Dereference(_) | Expression::FieldAccess(_,_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `right.typ.is_none()` [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: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !left.typ.is_some() || !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `left.typ.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:85:31 [INFO] [stdout] | [INFO] [stdout] 85 | if !left.typ.is_some() || !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `right.typ.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/x86_code_generator.rs:112:14 [INFO] [stdout] | [INFO] [stdout] 112 | .expect(&format!("Unkown variable {}", varname)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Unkown variable {}", varname))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/x86_code_generator.rs:123:14 [INFO] [stdout] | [INFO] [stdout] 123 | .expect(&format!("Unkown variable {}", varname)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Unkown variable {}", varname))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/x86_code_generator.rs:181:50 [INFO] [stdout] | [INFO] [stdout] 181 | assert!(block.declared_variables.len() < i32::max_value() as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 181 - assert!(block.declared_variables.len() < i32::max_value() as usize); [INFO] [stdout] 181 + assert!(block.declared_variables.len() < i32::MAX as usize); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:332:9 [INFO] [stdout] | [INFO] [stdout] 332 | return Statement::Return(expr); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 332 - return Statement::Return(expr); [INFO] [stdout] 332 + Statement::Return(expr) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:313:59 [INFO] [stdout] | [INFO] [stdout] 313 | let result_reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:444:9 [INFO] [stdout] | [INFO] [stdout] 444 | / return Function {name: fn_name, [INFO] [stdout] 445 | | statements: statements, [INFO] [stdout] 446 | | args: args, [INFO] [stdout] 447 | | fn_type: ast::FunctionType { [INFO] [stdout] ... | [INFO] [stdout] 452 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 444 ~ Function {name: fn_name, [INFO] [stdout] 445 + statements: statements, [INFO] [stdout] 446 + args: args, [INFO] [stdout] 447 + fn_type: ast::FunctionType { [INFO] [stdout] 448 + arg_types: arg_types, [INFO] [stdout] 449 + return_type: return_type, [INFO] [stdout] 450 + is_var_args: false, [INFO] [stdout] 451 + } [INFO] [stdout] 452 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:328:52 [INFO] [stdout] | [INFO] [stdout] 328 | let reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/x86_code_generator.rs:347:24 [INFO] [stdout] | [INFO] [stdout] 347 | if let &Some(ref else_statements) = else_block_opt { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 347 - if let &Some(ref else_statements) = else_block_opt { [INFO] [stdout] 347 + if let Some(else_statements) = else_block_opt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:365:52 [INFO] [stdout] | [INFO] [stdout] 365 | let reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/x86_code_generator.rs:396:24 [INFO] [stdout] | [INFO] [stdout] 396 | if let &Some(ref expr) = expr_opt { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 396 - if let &Some(ref expr) = expr_opt { [INFO] [stdout] 396 + if let Some(expr) = expr_opt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:546:5 [INFO] [stdout] | [INFO] [stdout] 544 | let prog = p.parse_program(tokens); [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 545 | [INFO] [stdout] 546 | prog [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 544 ~ [INFO] [stdout] 545 | [INFO] [stdout] 546 ~ p.parse_program(tokens) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BinaryOp` which implements the `Copy` trait [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:93:38 [INFO] [stdout] | [INFO] [stdout] 93 | Expression::BinaryOp(op.clone(), Box::new(left), [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `op` [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: the function `instruction_list_to_asm` doesn't need a mutable reference [INFO] [stdout] --> src/x86_code_generator.rs:583:48 [INFO] [stdout] | [INFO] [stdout] 583 | code.push_str(&instruction_list_to_asm(&mut self.instructions)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 583 - code.push_str(&instruction_list_to_asm(&mut self.instructions)); [INFO] [stdout] 583 + code.push_str(&instruction_list_to_asm(&self.instructions)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/pointer_arithmetic_transformer.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(expr) = value_expr { [INFO] [stdout] 145 | | Some(self.transform_expr(expr)) [INFO] [stdout] 146 | | } else { [INFO] [stdout] 147 | | None [INFO] [stdout] 148 | | }; [INFO] [stdout] | |_________________^ help: try: `value_expr.map(|expr| self.transform_expr(expr))` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:41:39 [INFO] [stdout] | [INFO] [stdout] 41 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/main.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if let Err(_) = result { [INFO] [stdout] | -------^^^^^^--------- help: try: `if result.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/representation_manager.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | return n; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 113 - return n; [INFO] [stdout] 113 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/representation_manager.rs:112:12 [INFO] [stdout] | [INFO] [stdout] 112 | if let &VarType::Struct(ref n) = typ { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 112 - if let &VarType::Struct(ref n) = typ { [INFO] [stdout] 112 + if let VarType::Struct(n) = typ { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scanner.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | assert!(token.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!token.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/scanner.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | if source.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `source.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` can be collapsed into the outer `match` [INFO] [stdout] --> src/scanner.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | / if next_char == Some('=') { [INFO] [stdout] 142 | | // We should append the '=' since '>=' is a single token [INFO] [stdout] 143 | | s.push(chars.pop_front().unwrap()); [INFO] [stdout] 144 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 140 ~ '>' | '<' | '=' | '!' [INFO] [stdout] 141 ~ if next_char == Some('=') => { [INFO] [stdout] 142 | // We should append the '=' since '>=' is a single token [INFO] [stdout] 143 | s.push(chars.pop_front().unwrap()); [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(struct_name).is_some()` [INFO] [stdout] --> src/type_checker.rs:105:43 [INFO] [stdout] | [INFO] [stdout] 105 | self.struct_to_definition.get(struct_name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(struct_name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/type_checker.rs:138:13 [INFO] [stdout] | [INFO] [stdout] 138 | if arg_type_opt.is_none() { return None; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `arg_type_opt.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/type_checker.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | assert_eq!(fn_type.is_var_args, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 152 - assert_eq!(fn_type.is_var_args, true); [INFO] [stdout] 152 + assert!(fn_type.is_var_args); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/type_checker.rs:162:12 [INFO] [stdout] | [INFO] [stdout] 162 | if res == None { [INFO] [stdout] | ^^^^^^^^^^^ help: use `Option::is_none()` instead: `res.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/type_checker.rs:223:37 [INFO] [stdout] | [INFO] [stdout] 223 | Expression::Value(v) if v >= 0 && v < 256 => Some(Char), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..256).contains(&v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/type_checker.rs:254:29 [INFO] [stdout] | [INFO] [stdout] 254 | if let Some(&VarType::Pointer(_, ref typ)) = typ_opt.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 254 - if let Some(&VarType::Pointer(_, ref typ)) = typ_opt.as_ref() { [INFO] [stdout] 254 + if let Some(VarType::Pointer(_, typ)) = typ_opt.as_ref() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/type_checker.rs:273:26 [INFO] [stdout] | [INFO] [stdout] 273 | .expect(&format!("Struct {} unkown!", struct_name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Struct {} unkown!", struct_name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/type_checker.rs:363:20 [INFO] [stdout] | [INFO] [stdout] 363 | if res == true { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `res` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` 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/type_checker_helper.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | return is_pointer(&l) && is_pointer(&r); [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:16:45 [INFO] [stdout] | [INFO] [stdout] 16 | return is_pointer(&l) && is_pointer(&r); [INFO] [stdout] | ^^ help: change this to: `r` [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: unneeded `return` statement [INFO] [stdout] --> src/type_checker_helper.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return false; [INFO] [stdout] 33 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/type_checker_helper.rs:29:28 [INFO] [stdout] | [INFO] [stdout] 29 | return (is_pointer(&l) && type_contains(&Int, &r)) || [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:29:55 [INFO] [stdout] | [INFO] [stdout] 29 | return (is_pointer(&l) && type_contains(&Int, &r)) || [INFO] [stdout] | ^^ help: change this to: `r` [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/type_checker_helper.rs:30:34 [INFO] [stdout] | [INFO] [stdout] 30 | (type_contains(&Int, &l) && is_pointer(&r)); [INFO] [stdout] | ^^ help: change this to: `l` [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/type_checker_helper.rs:30:52 [INFO] [stdout] | [INFO] [stdout] 30 | (type_contains(&Int, &l) && is_pointer(&r)); [INFO] [stdout] | ^^ help: change this to: `r` [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/type_checker_helper.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / match expr_node.expr { [INFO] [stdout] 40 | | Expression::Variable(_) => true, [INFO] [stdout] 41 | | Expression::Dereference(_) => true, [INFO] [stdout] 42 | | Expression::FieldAccess(_,_) => true, [INFO] [stdout] 43 | | _ => false [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 39 - match expr_node.expr { [INFO] [stdout] 40 - Expression::Variable(_) => true, [INFO] [stdout] 41 - Expression::Dereference(_) => true, [INFO] [stdout] 42 - Expression::FieldAccess(_,_) => true, [INFO] [stdout] 43 - _ => false [INFO] [stdout] 44 - } [INFO] [stdout] 39 + matches!(expr_node.expr, Expression::Variable(_) | Expression::Dereference(_) | Expression::FieldAccess(_,_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `right.typ.is_none()` [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: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !left.typ.is_some() || !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `left.typ.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/type_checker_helper.rs:85:31 [INFO] [stdout] | [INFO] [stdout] 85 | if !left.typ.is_some() || !right.typ.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `right.typ.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/x86_code_generator.rs:112:14 [INFO] [stdout] | [INFO] [stdout] 112 | .expect(&format!("Unkown variable {}", varname)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Unkown variable {}", varname))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/x86_code_generator.rs:123:14 [INFO] [stdout] | [INFO] [stdout] 123 | .expect(&format!("Unkown variable {}", varname)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Unkown variable {}", varname))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/x86_code_generator.rs:181:50 [INFO] [stdout] | [INFO] [stdout] 181 | assert!(block.declared_variables.len() < i32::max_value() as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 181 - assert!(block.declared_variables.len() < i32::max_value() as usize); [INFO] [stdout] 181 + assert!(block.declared_variables.len() < i32::MAX as usize); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:313:59 [INFO] [stdout] | [INFO] [stdout] 313 | let result_reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:328:52 [INFO] [stdout] | [INFO] [stdout] 328 | let reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/x86_code_generator.rs:347:24 [INFO] [stdout] | [INFO] [stdout] 347 | if let &Some(ref else_statements) = else_block_opt { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 347 - if let &Some(ref else_statements) = else_block_opt { [INFO] [stdout] 347 + if let Some(else_statements) = else_block_opt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/x86_code_generator.rs:365:52 [INFO] [stdout] | [INFO] [stdout] 365 | let reg = self.evaluate_expression(&expr); [INFO] [stdout] | ^^^^^ help: change this to: `expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/x86_code_generator.rs:396:24 [INFO] [stdout] | [INFO] [stdout] 396 | if let &Some(ref expr) = expr_opt { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 396 - if let &Some(ref expr) = expr_opt { [INFO] [stdout] 396 + if let Some(expr) = expr_opt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `instruction_list_to_asm` doesn't need a mutable reference [INFO] [stdout] --> src/x86_code_generator.rs:583:48 [INFO] [stdout] | [INFO] [stdout] 583 | code.push_str(&instruction_list_to_asm(&mut self.instructions)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 583 - code.push_str(&instruction_list_to_asm(&mut self.instructions)); [INFO] [stdout] 583 + code.push_str(&instruction_list_to_asm(&self.instructions)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:41:39 [INFO] [stdout] | [INFO] [stdout] 41 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/main.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if let Err(_) = result { [INFO] [stdout] | -------^^^^^^--------- help: try: `if result.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.66s [INFO] running `Command { std: "docker" "inspect" "0c3eb252ba4664d831b97958b79538d297b8221ec0ea819ed807a26a6732341c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0c3eb252ba4664d831b97958b79538d297b8221ec0ea819ed807a26a6732341c", kill_on_drop: false }` [INFO] [stdout] 0c3eb252ba4664d831b97958b79538d297b8221ec0ea819ed807a26a6732341c