[INFO] cloning repository https://github.com/djanderson/riscv-5stage-simulator [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/djanderson/riscv-5stage-simulator" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdjanderson%2Friscv-5stage-simulator", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdjanderson%2Friscv-5stage-simulator'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] f798c5103d156fb2f46bf4126a287424c2de81ca [INFO] linting djanderson/riscv-5stage-simulator against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdjanderson%2Friscv-5stage-simulator" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/djanderson/riscv-5stage-simulator [INFO] finished tweaking git repo https://github.com/djanderson/riscv-5stage-simulator [INFO] tweaked toml for git repo https://github.com/djanderson/riscv-5stage-simulator written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/djanderson/riscv-5stage-simulator 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/djanderson/riscv-5stage-simulator 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] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 56ad7d8b90644eb74768e2a77af2bdbf2fcd81167dd826845b64030df1342d90 [INFO] running `Command { std: "docker" "start" "-a" "56ad7d8b90644eb74768e2a77af2bdbf2fcd81167dd826845b64030df1342d90", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "56ad7d8b90644eb74768e2a77af2bdbf2fcd81167dd826845b64030df1342d90", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "56ad7d8b90644eb74768e2a77af2bdbf2fcd81167dd826845b64030df1342d90", kill_on_drop: false }` [INFO] [stdout] 56ad7d8b90644eb74768e2a77af2bdbf2fcd81167dd826845b64030df1342d90 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 0afc51f5ec252a5bc487dfaa0a63e70f5aafa1e18b9b655693b25ff49a9e3ddc [INFO] running `Command { std: "docker" "start" "-a" "0afc51f5ec252a5bc487dfaa0a63e70f5aafa1e18b9b655693b25ff49a9e3ddc", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking libc v0.2.33 [INFO] [stderr] Checking lazy_static v0.2.9 [INFO] [stderr] Checking regex-syntax v0.4.1 [INFO] [stderr] Checking utf8-ranges v1.0.0 [INFO] [stderr] Checking memchr v1.0.2 [INFO] [stderr] Checking thread_local v0.3.4 [INFO] [stderr] Checking aho-corasick v0.6.3 [INFO] [stderr] Checking regex v0.2.2 [INFO] [stderr] Checking env_logger v0.4.3 [INFO] [stderr] Checking riscv-5stage-simulator v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | 0b01_101_11 => Opcode::Lui, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] = note: `#[warn(clippy::unusual_byte_groupings)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | 0b00_101_11 => Opcode::AuiPc, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b001_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:74:9 [INFO] [stdout] | [INFO] [stdout] 74 | 0b11_011_11 => Opcode::Jal, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_1111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | 0b11_001_11 => Opcode::Jalr, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | 0b11_000_11 => Opcode::Branch, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | 0b00_000_11 => Opcode::Load, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b000_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | 0b01_000_11 => Opcode::Store, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b010_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | 0b01_100_11 => Opcode::Op, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | 0b00_100_11 => Opcode::OpImm, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b001_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | 0b01_111_11 => Opcode::Halt, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_1111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using tabs in doc comments is not recommended [INFO] [stdout] --> src/memory/instruction.rs:50:18 [INFO] [stdout] | [INFO] [stdout] 50 | /// 16c: 00 15 05 13 addi x10 , x10 , 1 [INFO] [stdout] | ^^^^ help: consider using four spaces per tab [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments [INFO] [stdout] = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ca_simulator.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 19 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ia_simulator.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 18 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/pipeline/stages.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 17 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/stages.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn insn_fetch(mem: &InstructionMemory, pc: u32, _clk: u64) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 13 | pub fn insn_fetch(mem: &dyn InstructionMemory, pc: u32, _clk: u64) -> u32 { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | 0b01_101_11 => Opcode::Lui, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] = note: `#[warn(clippy::unusual_byte_groupings)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | 0b00_101_11 => Opcode::AuiPc, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b001_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:74:9 [INFO] [stdout] | [INFO] [stdout] 74 | 0b11_011_11 => Opcode::Jal, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_1111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | 0b11_001_11 => Opcode::Jalr, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_0111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | 0b11_000_11 => Opcode::Branch, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b110_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | 0b00_000_11 => Opcode::Load, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b000_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | 0b01_000_11 => Opcode::Store, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b010_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | 0b01_100_11 => Opcode::Op, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | 0b00_100_11 => Opcode::OpImm, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b001_0011` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/instruction/mod.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | 0b01_111_11 => Opcode::Halt, [INFO] [stdout] | ^^^^^^^^^^^ help: consider: `0b011_1111` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using tabs in doc comments is not recommended [INFO] [stdout] --> src/memory/instruction.rs:50:18 [INFO] [stdout] | [INFO] [stdout] 50 | /// 16c: 00 15 05 13 addi x10 , x10 , 1 [INFO] [stdout] | ^^^^ help: consider using four spaces per tab [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments [INFO] [stdout] = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ca_simulator.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 19 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ia_simulator.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 18 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/pipeline/stages.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | insns: &InstructionMemory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 17 | insns: &dyn InstructionMemory, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/stages.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn insn_fetch(mem: &InstructionMemory, pc: u32, _clk: u64) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [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] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 13 | pub fn insn_fetch(mem: &dyn InstructionMemory, pc: u32, _clk: u64) -> u32 { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/alu.rs:17:27 [INFO] [stdout] | [INFO] [stdout] 17 | BranchOnEqual => (!(src1 == src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 != src2)` [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/alu.rs:18:30 [INFO] [stdout] | [INFO] [stdout] 18 | BranchOnNotEqual => (!(src1 != src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 == src2)` [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/alu.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | BranchOnLessThan => (!(src1 < src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `(src1 >= src2)` [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/alu.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | !((src1 as u32) < (src2 as u32)) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((src1 as u32) >= (src2 as u32))` [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/alu.rs:24:36 [INFO] [stdout] | [INFO] [stdout] 24 | BranchOnGreaterOrEqual => (!(src1 >= src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 < src2)` [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/alu.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | !((src1 as u32) >= (src2 as u32)) as [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((src1 as u32) < (src2 as u32))` [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 `impl` can be derived [INFO] [stdout] --> src/alu.rs:81:1 [INFO] [stdout] | [INFO] [stdout] 81 | / impl Default for AluOp { [INFO] [stdout] 82 | | fn default() -> AluOp { [INFO] [stdout] 83 | | AluOp::Add [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 56 + #[derive(Default)] [INFO] [stdout] 57 | pub enum AluOp { [INFO] [stdout] 58 | // Arithmetic ops [INFO] [stdout] 59 ~ #[default] [INFO] [stdout] 60 ~ Add, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/alu.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / impl Default for AluSrc { [INFO] [stdout] 97 | | fn default() -> AluSrc { [INFO] [stdout] 98 | | AluSrc::Reg [INFO] [stdout] 99 | | } [INFO] [stdout] 100 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 90 + #[derive(Default)] [INFO] [stdout] 91 | pub enum AluSrc { [INFO] [stdout] 92 ~ #[default] [INFO] [stdout] 93 ~ Reg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ca_simulator.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | insn_fetch(&mut write_pipeline, insns, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/ca_simulator.rs:35:62 [INFO] [stdout] | [INFO] [stdout] 35 | insn_decode(&read_pipeline, &mut write_pipeline, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/ca_simulator.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | &mut mem, [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/ca_simulator.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | &mut reg, [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/ca_simulator.rs:53:39 [INFO] [stdout] | [INFO] [stdout] 53 | reg_writeback(&read_pipeline, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/immediates.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | / match insn.fields.imm { [INFO] [stdout] 17 | | Some(v) => Some((((v as i32) << shamt) >> shamt) as u32), [INFO] [stdout] 18 | | None => None, [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ help: try: `insn.fields.imm.map(|v| (((v as i32) << shamt) >> shamt) as u32)` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ia_simulator.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | let (rs1, rs2) = reg_read(&insn, ®, clock); [INFO] [stdout] | ^^^^ help: change this to: `reg` [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/ia_simulator.rs:42:34 [INFO] [stdout] | [INFO] [stdout] 42 | access_memory(&insn, &mut mem, alu_result, rs2, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/ia_simulator.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | reg_writeback(pc, &insn, &mut reg, alu_result, mem_result, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/instruction/decoder.rs:20:39 [INFO] [stdout] | [INFO] [stdout] 20 | insn.fields.imm = immediates::gen(&insn); [INFO] [stdout] | ^^^^^ help: change this to: `insn` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | / semantics.branch = match insn.opcode { [INFO] [stdout] 92 | | Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 | | _ => false, [INFO] [stdout] 94 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Semantics { branch: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] _ => false, [INFO] [stdout] }, mem_read: insn.opcode == Opcode::Load, mem_to_reg: insn.opcode == Opcode::Load, alu_op: match (insn.opcode, insn.function) { [INFO] [stdout] (Opcode::Load, _) => Add, [INFO] [stdout] (Opcode::Store, _) => Add, [INFO] [stdout] (Opcode::Jal, _) => BranchOnEqual, [INFO] [stdout] (Opcode::Jalr, _) => Add, [INFO] [stdout] (Opcode::Branch, Function::Beq) => BranchOnEqual, [INFO] [stdout] (Opcode::Branch, Function::Bne) => BranchOnNotEqual, [INFO] [stdout] (Opcode::Branch, Function::Blt) => BranchOnLessThan, [INFO] [stdout] (Opcode::Branch, Function::Bltu) => BranchOnLessThanUnsigned, [INFO] [stdout] (Opcode::Branch, Function::Bge) => BranchOnGreaterOrEqual, [INFO] [stdout] (Opcode::Branch, Function::Bgeu) => BranchOnGreaterOrEqualUnsigned, [INFO] [stdout] (Opcode::OpImm, Function::Addi) => Add, [INFO] [stdout] (Opcode::OpImm, Function::Slti) => SetOnLessThan, [INFO] [stdout] (Opcode::OpImm, Function::Sltiu) => SetOnLessThanUnsigned, [INFO] [stdout] (Opcode::OpImm, Function::Xori) => Xor, [INFO] [stdout] (Opcode::OpImm, Function::Ori) => Or, [INFO] [stdout] (Opcode::OpImm, Function::Andi) => And, [INFO] [stdout] (Opcode::OpImm, Function::Slli) => ShiftLeft, [INFO] [stdout] (Opcode::OpImm, Function::Srli) => ShiftRightLogical, [INFO] [stdout] (Opcode::OpImm, Function::Srai) => ShiftRightArithmetic, [INFO] [stdout] (Opcode::Op, Function::Add) => Add, [INFO] [stdout] (Opcode::Op, Function::Sub) => Sub, [INFO] [stdout] (Opcode::Op, Function::Slt) => SetOnLessThan, [INFO] [stdout] (Opcode::Op, Function::Sltu) => SetOnLessThanUnsigned, [INFO] [stdout] (Opcode::Op, Function::Xor) => Xor, [INFO] [stdout] (Opcode::Op, Function::Or) => Or, [INFO] [stdout] (Opcode::Op, Function::And) => And, [INFO] [stdout] (Opcode::Op, Function::Sll) => ShiftLeft, [INFO] [stdout] (Opcode::Op, Function::Srl) => ShiftRightLogical, [INFO] [stdout] (Opcode::Op, Function::Sra) => ShiftRightArithmetic, [INFO] [stdout] (Opcode::Halt, _) | [INFO] [stdout] (Opcode::Lui, _) => Add, [INFO] [stdout] _ => panic!("ALU semanics for {:?} not implemented", insn.function), [INFO] [stdout] }, mem_write: insn.opcode == Opcode::Store, alu_src: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Op | Opcode::Jal => AluSrc::Reg, [INFO] [stdout] _ => AluSrc::Imm, [INFO] [stdout] }, reg_write: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Store => false, [INFO] [stdout] _ => true, [INFO] [stdout] }, mem_size: match insn.function { [INFO] [stdout] Function::Lb | Function::Lbu | Function::Sb => 1, [INFO] [stdout] Function::Lh | Function::Lhu | Function::Sh => 2, [INFO] [stdout] Function::Lw | Function::Sw => 4, [INFO] [stdout] _ => 0, [INFO] [stdout] } }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | let mut semantics = Semantics::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction/decoder.rs:91:24 [INFO] [stdout] | [INFO] [stdout] 91 | semantics.branch = match insn.opcode { [INFO] [stdout] | ________________________^ [INFO] [stdout] 92 | | Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 | | _ => false, [INFO] [stdout] 94 | | }; [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] 91 - semantics.branch = match insn.opcode { [INFO] [stdout] 92 - Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 - _ => false, [INFO] [stdout] 94 - }; [INFO] [stdout] 91 + semantics.branch = matches!(insn.opcode, Opcode::Branch | Opcode::Jal | Opcode::Jalr); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction/decoder.rs:136:27 [INFO] [stdout] | [INFO] [stdout] 136 | semantics.reg_write = match insn.opcode { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 137 | | Opcode::Branch | Opcode::Store => false, [INFO] [stdout] 138 | | _ => true, [INFO] [stdout] 139 | | }; [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] 136 - semantics.reg_write = match insn.opcode { [INFO] [stdout] 137 - Opcode::Branch | Opcode::Store => false, [INFO] [stdout] 138 - _ => true, [INFO] [stdout] 139 - }; [INFO] [stdout] 136 + semantics.reg_write = !matches!(insn.opcode, Opcode::Branch | Opcode::Store); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:154:5 [INFO] [stdout] | [INFO] [stdout] 154 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), funct7: Some((insn & FUNCT7_MASK) >> FUNCT7_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:153:5 [INFO] [stdout] | [INFO] [stdout] 153 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 174 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:210:5 [INFO] [stdout] | [INFO] [stdout] 210 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:209:5 [INFO] [stdout] | [INFO] [stdout] 209 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:231:5 [INFO] [stdout] | [INFO] [stdout] 231 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), rd: Some((insn & RD_MASK) >> RD_SHIFT), imm: Some(insn & 0xfffff000), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:230:5 [INFO] [stdout] | [INFO] [stdout] 230 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:243:5 [INFO] [stdout] | [INFO] [stdout] 243 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:242:5 [INFO] [stdout] | [INFO] [stdout] 242 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/alu.rs:17:27 [INFO] [stdout] | [INFO] [stdout] 17 | BranchOnEqual => (!(src1 == src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 != src2)` [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/alu.rs:18:30 [INFO] [stdout] | [INFO] [stdout] 18 | BranchOnNotEqual => (!(src1 != src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 == src2)` [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/alu.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | BranchOnLessThan => (!(src1 < src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `(src1 >= src2)` [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/alu.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | !((src1 as u32) < (src2 as u32)) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((src1 as u32) >= (src2 as u32))` [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/alu.rs:24:36 [INFO] [stdout] | [INFO] [stdout] 24 | BranchOnGreaterOrEqual => (!(src1 >= src2) as i32, false), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(src1 < src2)` [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/alu.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | !((src1 as u32) >= (src2 as u32)) as [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((src1 as u32) < (src2 as u32))` [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: unneeded `return` statement [INFO] [stdout] --> src/memory/data.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / return match size { [INFO] [stdout] 36 | | 1 => word & 0xff, // isolate least significant byte [INFO] [stdout] 37 | | 2 => word & 0xffff, // isolate least significant halfword [INFO] [stdout] 38 | | 4 => word, [INFO] [stdout] 39 | | _ => panic!("Can only read 1, 2, or 4 bytes at a time"), [INFO] [stdout] 40 | | }; [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] 35 ~ match size { [INFO] [stdout] 36 + 1 => word & 0xff, // isolate least significant byte [INFO] [stdout] 37 + 2 => word & 0xffff, // isolate least significant halfword [INFO] [stdout] 38 + 4 => word, [INFO] [stdout] 39 + _ => panic!("Can only read 1, 2, or 4 bytes at a time"), [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/alu.rs:81:1 [INFO] [stdout] | [INFO] [stdout] 81 | / impl Default for AluOp { [INFO] [stdout] 82 | | fn default() -> AluOp { [INFO] [stdout] 83 | | AluOp::Add [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 56 + #[derive(Default)] [INFO] [stdout] 57 | pub enum AluOp { [INFO] [stdout] 58 | // Arithmetic ops [INFO] [stdout] 59 ~ #[default] [INFO] [stdout] 60 ~ Add, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/alu.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / impl Default for AluSrc { [INFO] [stdout] 97 | | fn default() -> AluSrc { [INFO] [stdout] 98 | | AluSrc::Reg [INFO] [stdout] 99 | | } [INFO] [stdout] 100 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 90 + #[derive(Default)] [INFO] [stdout] 91 | pub enum AluSrc { [INFO] [stdout] 92 ~ #[default] [INFO] [stdout] 93 ~ Reg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ca_simulator.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | insn_fetch(&mut write_pipeline, insns, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/ca_simulator.rs:35:62 [INFO] [stdout] | [INFO] [stdout] 35 | insn_decode(&read_pipeline, &mut write_pipeline, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/ca_simulator.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | &mut mem, [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/ca_simulator.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | &mut reg, [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/memory/instruction.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | / match regex.captures(&l) { [INFO] [stdout] 65 | | Some(caps) => { [INFO] [stdout] 66 | | let addr = extract_addr(&caps).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 73 | | None => {} [INFO] [stdout] 74 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(caps) = regex.captures(&l) { [INFO] [stdout] 65 + let addr = extract_addr(&caps).unwrap(); [INFO] [stdout] 66 + // Test that addr matches the actual location in memory [INFO] [stdout] 67 + assert_eq!(addr, (mem.len() * 4) as u32); [INFO] [stdout] 68 + let insn = extract_insn(&caps).unwrap(); [INFO] [stdout] 69 + mem.push(insn); [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ca_simulator.rs:53:39 [INFO] [stdout] | [INFO] [stdout] 53 | reg_writeback(&read_pipeline, &mut reg, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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/memory/instruction.rs:143:25 [INFO] [stdout] | [INFO] [stdout] 143 | u32::from_str_radix(&s, 16) [INFO] [stdout] | ^^ help: change this to: `s` [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: unnecessary use of `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | &caps.name("byte2").unwrap().as_str().to_owned() + [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte2").unwrap().as_str()` [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 `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | &caps.name("byte3").unwrap().as_str().to_owned() + [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte3").unwrap().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | &caps.name("byte4").unwrap().as_str().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte4").unwrap().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/pipeline/stages.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | let rs1: i32; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `rs1` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 50 ~ [INFO] [stdout] 51 ~ let rs1: i32 = if hazards::reg_hazard_src1(&insn, write_pipeline) { [INFO] [stdout] 52 ~ match write_pipeline.mem_wb.insn.semantics.mem_read { [INFO] [stdout] 53 | true => write_pipeline.mem_wb.mem_result as i32, [INFO] [stdout] 54 | false => write_pipeline.mem_wb.alu_result, [INFO] [stdout] 55 ~ } [INFO] [stdout] 56 | } else { [INFO] [stdout] 57 ~ reg.gpr[insn.fields.rs1.unwrap_or(0) as usize].read() as i32 [INFO] [stdout] 58 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/pipeline/stages.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | let rs2: i32; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `rs2` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 60 ~ [INFO] [stdout] 61 ~ let rs2: i32 = if hazards::reg_hazard_src2(&insn, write_pipeline) { [INFO] [stdout] 62 ~ match write_pipeline.mem_wb.insn.semantics.mem_read { [INFO] [stdout] 63 | true => write_pipeline.mem_wb.mem_result as i32, [INFO] [stdout] 64 | false => write_pipeline.mem_wb.alu_result, [INFO] [stdout] 65 ~ } [INFO] [stdout] 66 | } else { [INFO] [stdout] 67 ~ reg.gpr[insn.fields.rs2.unwrap_or(0) as usize].read() as i32 [INFO] [stdout] 68 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pipeline/stages.rs:86:32 [INFO] [stdout] | [INFO] [stdout] 86 | if hazards::ex_hazard_src1(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:93:40 [INFO] [stdout] | [INFO] [stdout] 93 | } else if hazards::mem_hazard_src1(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:114:32 [INFO] [stdout] | [INFO] [stdout] 114 | if hazards::ex_hazard_src2(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:121:40 [INFO] [stdout] | [INFO] [stdout] 121 | } else if hazards::mem_hazard_src2(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/immediates.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | / match insn.fields.imm { [INFO] [stdout] 17 | | Some(v) => Some((((v as i32) << shamt) >> shamt) as u32), [INFO] [stdout] 18 | | None => None, [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ help: try: `insn.fields.imm.map(|v| (((v as i32) << shamt) >> shamt) as u32)` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pipeline/stages.rs:166:38 [INFO] [stdout] | [INFO] [stdout] 166 | stages::access_memory(&insn, &mut mem, alu_result, rs2, _clk); [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/pipeline/stages.rs:206:38 [INFO] [stdout] | [INFO] [stdout] 206 | stages::reg_writeback(pc, &insn, &mut reg, alu_result, mem_result, _clk); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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: you should consider adding a `Default` implementation for `Pipeline` [INFO] [stdout] --> src/pipeline/mod.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> Pipeline { [INFO] [stdout] 21 | | Pipeline { [INFO] [stdout] 22 | | if_id: IfIdRegister::new(), [INFO] [stdout] 23 | | id_ex: IdExRegister::new(), [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for Pipeline { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ia_simulator.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | let (rs1, rs2) = reg_read(&insn, ®, clock); [INFO] [stdout] | ^^^^ help: change this to: `reg` [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/ia_simulator.rs:42:34 [INFO] [stdout] | [INFO] [stdout] 42 | access_memory(&insn, &mut mem, alu_result, rs2, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/ia_simulator.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | reg_writeback(pc, &insn, &mut reg, alu_result, mem_result, clock); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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: you should consider adding a `Default` implementation for `IfIdRegister` [INFO] [stdout] --> src/pipeline/mod.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | / pub fn new() -> IfIdRegister { [INFO] [stdout] 44 | | IfIdRegister { [INFO] [stdout] 45 | | pc: 0, [INFO] [stdout] 46 | | raw_insn: 0x00_00_00_13, // NOP [INFO] [stdout] 47 | | } [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 42 + impl Default for IfIdRegister { [INFO] [stdout] 43 + fn default() -> Self { [INFO] [stdout] 44 + Self::new() [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `IdExRegister` [INFO] [stdout] --> src/pipeline/mod.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | / pub fn new() -> IdExRegister { [INFO] [stdout] 64 | | IdExRegister { [INFO] [stdout] 65 | | pc: 0, [INFO] [stdout] 66 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 62 + impl Default for IdExRegister { [INFO] [stdout] 63 + fn default() -> Self { [INFO] [stdout] 64 + Self::new() [INFO] [stdout] 65 + } [INFO] [stdout] 66 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ExMemRegister` [INFO] [stdout] --> src/pipeline/mod.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / pub fn new() -> ExMemRegister { [INFO] [stdout] 87 | | ExMemRegister { [INFO] [stdout] 88 | | pc: 0, [INFO] [stdout] 89 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 85 + impl Default for ExMemRegister { [INFO] [stdout] 86 + fn default() -> Self { [INFO] [stdout] 87 + Self::new() [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/instruction/decoder.rs:20:39 [INFO] [stdout] | [INFO] [stdout] 20 | insn.fields.imm = immediates::gen(&insn); [INFO] [stdout] | ^^^^^ help: change this to: `insn` [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: you should consider adding a `Default` implementation for `MemWbRegister` [INFO] [stdout] --> src/pipeline/mod.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | / pub fn new() -> MemWbRegister { [INFO] [stdout] 110 | | MemWbRegister { [INFO] [stdout] 111 | | pc: 0, [INFO] [stdout] 112 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 108 + impl Default for MemWbRegister { [INFO] [stdout] 109 + fn default() -> Self { [INFO] [stdout] 110 + Self::new() [INFO] [stdout] 111 + } [INFO] [stdout] 112 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | / semantics.branch = match insn.opcode { [INFO] [stdout] 92 | | Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 | | _ => false, [INFO] [stdout] 94 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Semantics { branch: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] _ => false, [INFO] [stdout] }, mem_read: insn.opcode == Opcode::Load, mem_to_reg: insn.opcode == Opcode::Load, alu_op: match (insn.opcode, insn.function) { [INFO] [stdout] (Opcode::Load, _) => Add, [INFO] [stdout] (Opcode::Store, _) => Add, [INFO] [stdout] (Opcode::Jal, _) => BranchOnEqual, [INFO] [stdout] (Opcode::Jalr, _) => Add, [INFO] [stdout] (Opcode::Branch, Function::Beq) => BranchOnEqual, [INFO] [stdout] (Opcode::Branch, Function::Bne) => BranchOnNotEqual, [INFO] [stdout] (Opcode::Branch, Function::Blt) => BranchOnLessThan, [INFO] [stdout] (Opcode::Branch, Function::Bltu) => BranchOnLessThanUnsigned, [INFO] [stdout] (Opcode::Branch, Function::Bge) => BranchOnGreaterOrEqual, [INFO] [stdout] (Opcode::Branch, Function::Bgeu) => BranchOnGreaterOrEqualUnsigned, [INFO] [stdout] (Opcode::OpImm, Function::Addi) => Add, [INFO] [stdout] (Opcode::OpImm, Function::Slti) => SetOnLessThan, [INFO] [stdout] (Opcode::OpImm, Function::Sltiu) => SetOnLessThanUnsigned, [INFO] [stdout] (Opcode::OpImm, Function::Xori) => Xor, [INFO] [stdout] (Opcode::OpImm, Function::Ori) => Or, [INFO] [stdout] (Opcode::OpImm, Function::Andi) => And, [INFO] [stdout] (Opcode::OpImm, Function::Slli) => ShiftLeft, [INFO] [stdout] (Opcode::OpImm, Function::Srli) => ShiftRightLogical, [INFO] [stdout] (Opcode::OpImm, Function::Srai) => ShiftRightArithmetic, [INFO] [stdout] (Opcode::Op, Function::Add) => Add, [INFO] [stdout] (Opcode::Op, Function::Sub) => Sub, [INFO] [stdout] (Opcode::Op, Function::Slt) => SetOnLessThan, [INFO] [stdout] (Opcode::Op, Function::Sltu) => SetOnLessThanUnsigned, [INFO] [stdout] (Opcode::Op, Function::Xor) => Xor, [INFO] [stdout] (Opcode::Op, Function::Or) => Or, [INFO] [stdout] (Opcode::Op, Function::And) => And, [INFO] [stdout] (Opcode::Op, Function::Sll) => ShiftLeft, [INFO] [stdout] (Opcode::Op, Function::Srl) => ShiftRightLogical, [INFO] [stdout] (Opcode::Op, Function::Sra) => ShiftRightArithmetic, [INFO] [stdout] (Opcode::Halt, _) | [INFO] [stdout] (Opcode::Lui, _) => Add, [INFO] [stdout] _ => panic!("ALU semanics for {:?} not implemented", insn.function), [INFO] [stdout] }, mem_write: insn.opcode == Opcode::Store, alu_src: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Op | Opcode::Jal => AluSrc::Reg, [INFO] [stdout] _ => AluSrc::Imm, [INFO] [stdout] }, reg_write: match insn.opcode { [INFO] [stdout] Opcode::Branch | Opcode::Store => false, [INFO] [stdout] _ => true, [INFO] [stdout] }, mem_size: match insn.function { [INFO] [stdout] Function::Lb | Function::Lbu | Function::Sb => 1, [INFO] [stdout] Function::Lh | Function::Lhu | Function::Sh => 2, [INFO] [stdout] Function::Lw | Function::Sw => 4, [INFO] [stdout] _ => 0, [INFO] [stdout] } }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | let mut semantics = Semantics::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction/decoder.rs:91:24 [INFO] [stdout] | [INFO] [stdout] 91 | semantics.branch = match insn.opcode { [INFO] [stdout] | ________________________^ [INFO] [stdout] 92 | | Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 | | _ => false, [INFO] [stdout] 94 | | }; [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] 91 - semantics.branch = match insn.opcode { [INFO] [stdout] 92 - Opcode::Branch | Opcode::Jal | Opcode::Jalr => true, [INFO] [stdout] 93 - _ => false, [INFO] [stdout] 94 - }; [INFO] [stdout] 91 + semantics.branch = matches!(insn.opcode, Opcode::Branch | Opcode::Jal | Opcode::Jalr); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/stages.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | alu(&insn, src1, src2, _clk) [INFO] [stdout] | ^^^^^ help: change this to: `insn` [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/instruction/decoder.rs:136:27 [INFO] [stdout] | [INFO] [stdout] 136 | semantics.reg_write = match insn.opcode { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 137 | | Opcode::Branch | Opcode::Store => false, [INFO] [stdout] 138 | | _ => true, [INFO] [stdout] 139 | | }; [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] 136 - semantics.reg_write = match insn.opcode { [INFO] [stdout] 137 - Opcode::Branch | Opcode::Store => false, [INFO] [stdout] 138 - _ => true, [INFO] [stdout] 139 - }; [INFO] [stdout] 136 + semantics.reg_write = !matches!(insn.opcode, Opcode::Branch | Opcode::Store); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:154:5 [INFO] [stdout] | [INFO] [stdout] 154 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), funct7: Some((insn & FUNCT7_MASK) >> FUNCT7_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:153:5 [INFO] [stdout] | [INFO] [stdout] 153 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 174 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:210:5 [INFO] [stdout] | [INFO] [stdout] 210 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), funct3: Some((insn & FUNCT3_MASK) >> FUNCT3_SHIFT), rs1: Some((insn & RS1_MASK) >> RS1_SHIFT), rs2: Some((insn & RS2_MASK) >> RS2_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:209:5 [INFO] [stdout] | [INFO] [stdout] 209 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:231:5 [INFO] [stdout] | [INFO] [stdout] 231 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), rd: Some((insn & RD_MASK) >> RD_SHIFT), imm: Some(insn & 0xfffff000), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:230:5 [INFO] [stdout] | [INFO] [stdout] 230 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction/decoder.rs:243:5 [INFO] [stdout] | [INFO] [stdout] 243 | fields.opcode = Some(insn & OPCODE_MASK); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Fields { opcode: Some(insn & OPCODE_MASK), rd: Some((insn & RD_MASK) >> RD_SHIFT), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction/decoder.rs:242:5 [INFO] [stdout] | [INFO] [stdout] 242 | let mut fields = Fields::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/memory/data.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / return match size { [INFO] [stdout] 36 | | 1 => word & 0xff, // isolate least significant byte [INFO] [stdout] 37 | | 2 => word & 0xffff, // isolate least significant halfword [INFO] [stdout] 38 | | 4 => word, [INFO] [stdout] 39 | | _ => panic!("Can only read 1, 2, or 4 bytes at a time"), [INFO] [stdout] 40 | | }; [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] 35 ~ match size { [INFO] [stdout] 36 + 1 => word & 0xff, // isolate least significant byte [INFO] [stdout] 37 + 2 => word & 0xffff, // isolate least significant halfword [INFO] [stdout] 38 + 4 => word, [INFO] [stdout] 39 + _ => panic!("Can only read 1, 2, or 4 bytes at a time"), [INFO] [stdout] 40 ~ } [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/memory/instruction.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | / match regex.captures(&l) { [INFO] [stdout] 65 | | Some(caps) => { [INFO] [stdout] 66 | | let addr = extract_addr(&caps).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 73 | | None => {} [INFO] [stdout] 74 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(caps) = regex.captures(&l) { [INFO] [stdout] 65 + let addr = extract_addr(&caps).unwrap(); [INFO] [stdout] 66 + // Test that addr matches the actual location in memory [INFO] [stdout] 67 + assert_eq!(addr, (mem.len() * 4) as u32); [INFO] [stdout] 68 + let insn = extract_insn(&caps).unwrap(); [INFO] [stdout] 69 + mem.push(insn); [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/memory/instruction.rs:143:25 [INFO] [stdout] | [INFO] [stdout] 143 | u32::from_str_radix(&s, 16) [INFO] [stdout] | ^^ help: change this to: `s` [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: unnecessary use of `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | &caps.name("byte2").unwrap().as_str().to_owned() + [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte2").unwrap().as_str()` [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 `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | &caps.name("byte3").unwrap().as_str().to_owned() + [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte3").unwrap().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/memory/instruction.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | &caps.name("byte4").unwrap().as_str().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `caps.name("byte4").unwrap().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/pipeline/stages.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | let rs1: i32; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `rs1` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 50 ~ [INFO] [stdout] 51 ~ let rs1: i32 = if hazards::reg_hazard_src1(&insn, write_pipeline) { [INFO] [stdout] 52 ~ match write_pipeline.mem_wb.insn.semantics.mem_read { [INFO] [stdout] 53 | true => write_pipeline.mem_wb.mem_result as i32, [INFO] [stdout] 54 | false => write_pipeline.mem_wb.alu_result, [INFO] [stdout] 55 ~ } [INFO] [stdout] 56 | } else { [INFO] [stdout] 57 ~ reg.gpr[insn.fields.rs1.unwrap_or(0) as usize].read() as i32 [INFO] [stdout] 58 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/pipeline/stages.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | let rs2: i32; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `rs2` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 60 ~ [INFO] [stdout] 61 ~ let rs2: i32 = if hazards::reg_hazard_src2(&insn, write_pipeline) { [INFO] [stdout] 62 ~ match write_pipeline.mem_wb.insn.semantics.mem_read { [INFO] [stdout] 63 | true => write_pipeline.mem_wb.mem_result as i32, [INFO] [stdout] 64 | false => write_pipeline.mem_wb.alu_result, [INFO] [stdout] 65 ~ } [INFO] [stdout] 66 | } else { [INFO] [stdout] 67 ~ reg.gpr[insn.fields.rs2.unwrap_or(0) as usize].read() as i32 [INFO] [stdout] 68 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pipeline/stages.rs:86:32 [INFO] [stdout] | [INFO] [stdout] 86 | if hazards::ex_hazard_src1(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:93:40 [INFO] [stdout] | [INFO] [stdout] 93 | } else if hazards::mem_hazard_src1(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> tests/riscv_32i_disassembly.rs:13:23 [INFO] [stdout] | [INFO] [stdout] 13 | use std::sync::{Once, ONCE_INIT}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> tests/riscv_32i_disassembly.rs:16:21 [INFO] [stdout] | [INFO] [stdout] 16 | static INIT: Once = ONCE_INIT; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: replace the use of the deprecated constant [INFO] [stdout] | [INFO] [stdout] 16 - static INIT: Once = ONCE_INIT; [INFO] [stdout] 16 + static INIT: Once = Once::new(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pipeline/stages.rs:114:32 [INFO] [stdout] | [INFO] [stdout] 114 | if hazards::ex_hazard_src2(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:121:40 [INFO] [stdout] | [INFO] [stdout] 121 | } else if hazards::mem_hazard_src2(&read_pipeline) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `read_pipeline` [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/pipeline/stages.rs:166:38 [INFO] [stdout] | [INFO] [stdout] 166 | stages::access_memory(&insn, &mut mem, alu_result, rs2, _clk); [INFO] [stdout] | ^^^^^^^^ help: change this to: `mem` [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/pipeline/stages.rs:206:38 [INFO] [stdout] | [INFO] [stdout] 206 | stages::reg_writeback(pc, &insn, &mut reg, alu_result, mem_result, _clk); [INFO] [stdout] | ^^^^^^^^ help: change this to: `reg` [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: you should consider adding a `Default` implementation for `Pipeline` [INFO] [stdout] --> src/pipeline/mod.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> Pipeline { [INFO] [stdout] 21 | | Pipeline { [INFO] [stdout] 22 | | if_id: IfIdRegister::new(), [INFO] [stdout] 23 | | id_ex: IdExRegister::new(), [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for Pipeline { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `IfIdRegister` [INFO] [stdout] --> src/pipeline/mod.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | / pub fn new() -> IfIdRegister { [INFO] [stdout] 44 | | IfIdRegister { [INFO] [stdout] 45 | | pc: 0, [INFO] [stdout] 46 | | raw_insn: 0x00_00_00_13, // NOP [INFO] [stdout] 47 | | } [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 42 + impl Default for IfIdRegister { [INFO] [stdout] 43 + fn default() -> Self { [INFO] [stdout] 44 + Self::new() [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `IdExRegister` [INFO] [stdout] --> src/pipeline/mod.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | / pub fn new() -> IdExRegister { [INFO] [stdout] 64 | | IdExRegister { [INFO] [stdout] 65 | | pc: 0, [INFO] [stdout] 66 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 62 + impl Default for IdExRegister { [INFO] [stdout] 63 + fn default() -> Self { [INFO] [stdout] 64 + Self::new() [INFO] [stdout] 65 + } [INFO] [stdout] 66 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ExMemRegister` [INFO] [stdout] --> src/pipeline/mod.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / pub fn new() -> ExMemRegister { [INFO] [stdout] 87 | | ExMemRegister { [INFO] [stdout] 88 | | pc: 0, [INFO] [stdout] 89 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 85 + impl Default for ExMemRegister { [INFO] [stdout] 86 + fn default() -> Self { [INFO] [stdout] 87 + Self::new() [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MemWbRegister` [INFO] [stdout] --> src/pipeline/mod.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | / pub fn new() -> MemWbRegister { [INFO] [stdout] 110 | | MemWbRegister { [INFO] [stdout] 111 | | pc: 0, [INFO] [stdout] 112 | | insn: Instruction::default(), [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 108 + impl Default for MemWbRegister { [INFO] [stdout] 109 + fn default() -> Self { [INFO] [stdout] 110 + Self::new() [INFO] [stdout] 111 + } [INFO] [stdout] 112 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/stages.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | alu(&insn, src1, src2, _clk) [INFO] [stdout] | ^^^^^ help: change this to: `insn` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.42s [INFO] running `Command { std: "docker" "inspect" "0afc51f5ec252a5bc487dfaa0a63e70f5aafa1e18b9b655693b25ff49a9e3ddc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0afc51f5ec252a5bc487dfaa0a63e70f5aafa1e18b9b655693b25ff49a9e3ddc", kill_on_drop: false }` [INFO] [stdout] 0afc51f5ec252a5bc487dfaa0a63e70f5aafa1e18b9b655693b25ff49a9e3ddc