[INFO] cloning repository https://github.com/joeoneil/rtool [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/joeoneil/rtool" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjoeoneil%2Frtool", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjoeoneil%2Frtool'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 160b91b7f8abb60582dd3f01a4125839ae0540be [INFO] linting joeoneil/rtool against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjoeoneil%2Frtool" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/joeoneil/rtool [INFO] finished tweaking git repo https://github.com/joeoneil/rtool [INFO] tweaked toml for git repo https://github.com/joeoneil/rtool written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/joeoneil/rtool 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/joeoneil/rtool 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 59efff5893e4905f96a68be17c69067cc93c972d0f6e0b257101d4066a1ab5f2 [INFO] running `Command { std: "docker" "start" "-a" "59efff5893e4905f96a68be17c69067cc93c972d0f6e0b257101d4066a1ab5f2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "59efff5893e4905f96a68be17c69067cc93c972d0f6e0b257101d4066a1ab5f2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "59efff5893e4905f96a68be17c69067cc93c972d0f6e0b257101d4066a1ab5f2", kill_on_drop: false }` [INFO] [stdout] 59efff5893e4905f96a68be17c69067cc93c972d0f6e0b257101d4066a1ab5f2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] e152cc6a8da716300a8dd5036eaae5e6d97e7d5b20d920241f73b56b3900d738 [INFO] running `Command { std: "docker" "start" "-a" "e152cc6a8da716300a8dd5036eaae5e6d97e7d5b20d920241f73b56b3900d738", kill_on_drop: false }` [INFO] [stderr] Checking anstyle-query v1.1.1 [INFO] [stderr] Checking colorchoice v1.0.2 [INFO] [stderr] Checking anstyle-parse v0.2.5 [INFO] [stderr] Checking anstyle v1.0.8 [INFO] [stderr] Checking clap_lex v0.7.2 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Checking anstream v0.6.15 [INFO] [stderr] Checking clap_builder v4.5.20 [INFO] [stderr] Compiling thiserror-impl v1.0.63 [INFO] [stderr] Compiling clap_derive v4.5.18 [INFO] [stderr] Compiling thiserror v1.0.63 [INFO] [stderr] Checking pest v2.7.11 [INFO] [stderr] Checking clap v4.5.20 [INFO] [stderr] Compiling pest_meta v2.7.11 [INFO] [stderr] Compiling pest_generator v2.7.11 [INFO] [stderr] Compiling pest_derive v2.7.11 [INFO] [stderr] Checking rtool v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/asm/mod.rs:198:48 [INFO] [stdout] | [INFO] [stdout] 198 | pub fn dbg_parse(input: String, rule: Rule) -> Result<(), pest::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `pest::error::Error`, for example by boxing large elements or replacing it with `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/asm/mod.rs:237:38 [INFO] [stdout] | [INFO] [stdout] 237 | pub fn dbg_parse_2(input: String) -> Result<(), pest::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `pest::error::Error`, for example by boxing large elements or replacing it with `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/common/module.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | symtab: (0..0x8000) [INFO] [stdout] | _________________^ [INFO] [stdout] 122 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `(0..0x8000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/common/module.rs:220:30 [INFO] [stdout] | [INFO] [stdout] 220 | let mut bytes = data.into_iter().skip(52); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:345:12 [INFO] [stdout] | [INFO] [stdout] 345 | if data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/common/module.rs:363:17 [INFO] [stdout] | [INFO] [stdout] 363 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 363 - print!("\n"); [INFO] [stdout] 363 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:371:12 [INFO] [stdout] | [INFO] [stdout] 371 | if self.rel_info.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.rel_info.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:399:12 [INFO] [stdout] | [INFO] [stdout] 399 | if self.ext_ref.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.ext_ref.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/common/module.rs:406:26 [INFO] [stdout] | [INFO] [stdout] 406 | .expect(format!("Invalid reftab entry offset {}", r.str_off).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid reftab entry offset {}", r.str_off))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:430:12 [INFO] [stdout] | [INFO] [stdout] 430 | if self.symtab.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.symtab.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/common/module.rs:437:26 [INFO] [stdout] | [INFO] [stdout] 437 | .expect(format!("Invalid symtab entry offset {}", s.str_off).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid symtab entry offset {}", s.str_off))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/common/module.rs:477:22 [INFO] [stdout] | [INFO] [stdout] 477 | .get((offset - 1) as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((offset - 1))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:530:9 [INFO] [stdout] | [INFO] [stdout] 530 | / for i in 0..4 { [INFO] [stdout] 531 | | buf[i] = a_bytes[i]; [INFO] [stdout] 532 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&a_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:557:9 [INFO] [stdout] | [INFO] [stdout] 557 | / for i in 0..4 { [INFO] [stdout] 558 | | buf[i] = a_bytes[i]; [INFO] [stdout] 559 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&a_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:562:9 [INFO] [stdout] | [INFO] [stdout] 562 | / for i in 0..4 { [INFO] [stdout] 563 | | buf[i + 4] = off_bytes[i]; [INFO] [stdout] 564 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[4..(4 + 4)].copy_from_slice(&off_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:570:9 [INFO] [stdout] | [INFO] [stdout] 570 | / for i in 0..2 { [INFO] [stdout] 571 | | buf[i + 10] = ix_bytes[i]; [INFO] [stdout] 572 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[10..(2 + 10)].copy_from_slice(&ix_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:603:9 [INFO] [stdout] | [INFO] [stdout] 603 | / for i in 0..4 { [INFO] [stdout] 604 | | buf[i] = f_bytes[i]; [INFO] [stdout] 605 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&f_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:608:9 [INFO] [stdout] | [INFO] [stdout] 608 | / for i in 0..4 { [INFO] [stdout] 609 | | buf[i + 4] = v_bytes[i]; [INFO] [stdout] 610 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[4..(4 + 4)].copy_from_slice(&v_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:613:9 [INFO] [stdout] | [INFO] [stdout] 613 | / for i in 0..4 { [INFO] [stdout] 614 | | buf[i + 8] = s_bytes[i]; [INFO] [stdout] 615 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[8..(4 + 8)].copy_from_slice(&s_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:618:9 [INFO] [stdout] | [INFO] [stdout] 618 | / for i in 0..2 { [INFO] [stdout] 619 | | buf[i + 12] = o_bytes[i]; [INFO] [stdout] 620 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[12..(2 + 12)].copy_from_slice(&o_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/mod.rs:138:8 [INFO] [stdout] | [INFO] [stdout] 138 | if s.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/dump.rs:50:30 [INFO] [stdout] | [INFO] [stdout] 50 | .map(|f| fs::read(f).expect(format!("Failed to read file {}", f).as_str())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/dump.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `oms` [INFO] [stdout] --> src/dump.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | for i in 0..oms.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 55 - for i in 0..oms.len() { [INFO] [stdout] 55 + for (i, ) in oms.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `OMLinkInfo` which implements the `Copy` trait [INFO] [stdout] --> src/link/linker.rs:38:35 [INFO] [stdout] | [INFO] [stdout] 38 | let out = (o.clone(), info.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/link/linker.rs:107:12 [INFO] [stdout] | [INFO] [stdout] 107 | *val = ((*val + align - 1) / align) * align; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(*val).div_ceil(align)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/asm/mod.rs:198:48 [INFO] [stdout] | [INFO] [stdout] 198 | pub fn dbg_parse(input: String, rule: Rule) -> Result<(), pest::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `pest::error::Error`, for example by boxing large elements or replacing it with `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/asm/mod.rs:237:38 [INFO] [stdout] | [INFO] [stdout] 237 | pub fn dbg_parse_2(input: String) -> Result<(), pest::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `pest::error::Error`, for example by boxing large elements or replacing it with `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/link/linker.rs:142:51 [INFO] [stdout] | [INFO] [stdout] 142 | let mut bytes = s.as_bytes_with_nul().into_iter().copied().collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/common/module.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | symtab: (0..0x8000) [INFO] [stdout] | _________________^ [INFO] [stdout] 122 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `(0..0x8000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/common/module.rs:220:30 [INFO] [stdout] | [INFO] [stdout] 220 | let mut bytes = data.into_iter().skip(52); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:345:12 [INFO] [stdout] | [INFO] [stdout] 345 | if data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:161:14 [INFO] [stdout] | [INFO] [stdout] 161 | .expect(format!("Invalid object module {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid object module {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:159:35 [INFO] [stdout] | [INFO] [stdout] 159 | &std::fs::read(f).expect(format!("Could not read file {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Could not read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/common/module.rs:363:17 [INFO] [stdout] | [INFO] [stdout] 363 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 363 - print!("\n"); [INFO] [stdout] 363 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | .expect(format!("Invalid object module {}", f).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid object module {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:167:31 [INFO] [stdout] | [INFO] [stdout] 167 | &std::fs::read(f).expect(format!("Could not read file {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Could not read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:371:12 [INFO] [stdout] | [INFO] [stdout] 371 | if self.rel_info.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.rel_info.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:399:12 [INFO] [stdout] | [INFO] [stdout] 399 | if self.ext_ref.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.ext_ref.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/common/module.rs:406:26 [INFO] [stdout] | [INFO] [stdout] 406 | .expect(format!("Invalid reftab entry offset {}", r.str_off).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid reftab entry offset {}", r.str_off))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/module.rs:430:12 [INFO] [stdout] | [INFO] [stdout] 430 | if self.symtab.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.symtab.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/common/module.rs:437:26 [INFO] [stdout] | [INFO] [stdout] 437 | .expect(format!("Invalid symtab entry offset {}", s.str_off).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid symtab entry offset {}", s.str_off))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/sim/exec.rs:262:28 [INFO] [stdout] | [INFO] [stdout] 262 | if !((imm & 0x8000) > 0) && self.ctx.reg[rs as usize] < (imm as u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((imm & 0x8000) <= 0)` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/common/module.rs:477:22 [INFO] [stdout] | [INFO] [stdout] 477 | .get((offset - 1) as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((offset - 1))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:530:9 [INFO] [stdout] | [INFO] [stdout] 530 | / for i in 0..4 { [INFO] [stdout] 531 | | buf[i] = a_bytes[i]; [INFO] [stdout] 532 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&a_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:557:9 [INFO] [stdout] | [INFO] [stdout] 557 | / for i in 0..4 { [INFO] [stdout] 558 | | buf[i] = a_bytes[i]; [INFO] [stdout] 559 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&a_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:562:9 [INFO] [stdout] | [INFO] [stdout] 562 | / for i in 0..4 { [INFO] [stdout] 563 | | buf[i + 4] = off_bytes[i]; [INFO] [stdout] 564 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[4..(4 + 4)].copy_from_slice(&off_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:570:9 [INFO] [stdout] | [INFO] [stdout] 570 | / for i in 0..2 { [INFO] [stdout] 571 | | buf[i + 10] = ix_bytes[i]; [INFO] [stdout] 572 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[10..(2 + 10)].copy_from_slice(&ix_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/sim/exec.rs:130:24 [INFO] [stdout] | [INFO] [stdout] 130 | if b == 0 { [INFO] [stdout] | ^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 133 | self.ctx.lo = (a / b); [INFO] [stdout] | ------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:603:9 [INFO] [stdout] | [INFO] [stdout] 603 | / for i in 0..4 { [INFO] [stdout] 604 | | buf[i] = f_bytes[i]; [INFO] [stdout] 605 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[..4].copy_from_slice(&f_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:608:9 [INFO] [stdout] | [INFO] [stdout] 608 | / for i in 0..4 { [INFO] [stdout] 609 | | buf[i + 4] = v_bytes[i]; [INFO] [stdout] 610 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[4..(4 + 4)].copy_from_slice(&v_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:613:9 [INFO] [stdout] | [INFO] [stdout] 613 | / for i in 0..4 { [INFO] [stdout] 614 | | buf[i + 8] = s_bytes[i]; [INFO] [stdout] 615 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[8..(4 + 8)].copy_from_slice(&s_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/common/module.rs:618:9 [INFO] [stdout] | [INFO] [stdout] 618 | / for i in 0..2 { [INFO] [stdout] 619 | | buf[i + 12] = o_bytes[i]; [INFO] [stdout] 620 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `buf[12..(2 + 12)].copy_from_slice(&o_bytes);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/mod.rs:138:8 [INFO] [stdout] | [INFO] [stdout] 138 | if s.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/sim/exec.rs:450:37 [INFO] [stdout] | [INFO] [stdout] 450 | let new_pages = (self.ctx.reg[4] + PAGE_SIZE - 1) / PAGE_SIZE; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `self.ctx.reg[4].div_ceil(PAGE_SIZE)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/dump.rs:50:30 [INFO] [stdout] | [INFO] [stdout] 50 | .map(|f| fs::read(f).expect(format!("Failed to read file {}", f).as_str())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/dump.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `oms` [INFO] [stdout] --> src/dump.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | for i in 0..oms.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 55 - for i in 0..oms.len() { [INFO] [stdout] 55 + for (i, ) in oms.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `OMLinkInfo` which implements the `Copy` trait [INFO] [stdout] --> src/link/linker.rs:38:35 [INFO] [stdout] | [INFO] [stdout] 38 | let out = (o.clone(), info.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/sim/exec.rs:672:9 [INFO] [stdout] | [INFO] [stdout] 672 | / match &self.exn { [INFO] [stdout] 673 | | Some(e) => { [INFO] [stdout] 674 | | return Err(Error::UnhandledException(format!( [INFO] [stdout] 675 | | "Unhandled Exception: {}", [INFO] [stdout] ... | [INFO] [stdout] 702 | | None => {} [INFO] [stdout] 703 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 672 ~ if let Some(e) = &self.exn { [INFO] [stdout] 673 + return Err(Error::UnhandledException(format!( [INFO] [stdout] 674 + "Unhandled Exception: {}", [INFO] [stdout] 675 + match e { [INFO] [stdout] 676 + Exception::Timer => { [INFO] [stdout] 677 + String::from("Unimplemented!?") [INFO] [stdout] 678 + } [INFO] [stdout] 679 + Exception::Overflow => { [INFO] [stdout] 680 + String::from("Overflow exception") [INFO] [stdout] 681 + } [INFO] [stdout] 682 + Exception::Exit(code) => { [INFO] [stdout] 683 + format!("Exit with code {}", code) [INFO] [stdout] 684 + } [INFO] [stdout] 685 + Exception::Syscall(operand) => { [INFO] [stdout] 686 + format!("Syscall with operand {}", operand) [INFO] [stdout] 687 + } [INFO] [stdout] 688 + Exception::DivideByZero => { [INFO] [stdout] 689 + String::from("Divide by zero") [INFO] [stdout] 690 + } [INFO] [stdout] 691 + Exception::Memory(Error::MemoryAccessError(e)) => { [INFO] [stdout] 692 + format!("Memory exception: {}", e) [INFO] [stdout] 693 + } [INFO] [stdout] 694 + Exception::Memory(_) => unreachable!(), [INFO] [stdout] 695 + Exception::Break(operand) => { [INFO] [stdout] 696 + format!("Break with operand {}", operand) [INFO] [stdout] 697 + } [INFO] [stdout] 698 + } [INFO] [stdout] 699 + ))); [INFO] [stdout] 700 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/link/linker.rs:107:12 [INFO] [stdout] | [INFO] [stdout] 107 | *val = ((*val + align - 1) / align) * align; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(*val).div_ceil(align)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/link/linker.rs:142:51 [INFO] [stdout] | [INFO] [stdout] 142 | let mut bytes = s.as_bytes_with_nul().into_iter().copied().collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if addr % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 66 | if addr % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:161:14 [INFO] [stdout] | [INFO] [stdout] 161 | .expect(format!("Invalid object module {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid object module {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:159:35 [INFO] [stdout] | [INFO] [stdout] 159 | &std::fs::read(f).expect(format!("Could not read file {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Could not read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | .expect(format!("Invalid object module {}", f).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid object module {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/link/mod.rs:167:31 [INFO] [stdout] | [INFO] [stdout] 167 | &std::fs::read(f).expect(format!("Could not read file {}", f).as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Could not read file {}", f))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/sim/exec.rs:262:28 [INFO] [stdout] | [INFO] [stdout] 262 | if !((imm & 0x8000) > 0) && self.ctx.reg[rs as usize] < (imm as u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `((imm & 0x8000) <= 0)` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:108:12 [INFO] [stdout] | [INFO] [stdout] 108 | if addr % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/sim/exec.rs:130:24 [INFO] [stdout] | [INFO] [stdout] 130 | if b == 0 { [INFO] [stdout] | ^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 133 | self.ctx.lo = (a / b); [INFO] [stdout] | ------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:146:12 [INFO] [stdout] | [INFO] [stdout] 146 | if addr % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/sim/mem.rs:228:9 [INFO] [stdout] | [INFO] [stdout] 228 | / if self.table.contains_key(&virt_id) { [INFO] [stdout] 229 | | None [INFO] [stdout] 230 | | } else { [INFO] [stdout] 231 | | self.table.insert(virt_id, real_id); [INFO] [stdout] ... | [INFO] [stdout] 235 | | self.pages.get_mut(real_id.0 as usize) [INFO] [stdout] 236 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 228 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.table.entry(virt_id) { [INFO] [stdout] 229 + e.insert(real_id); [INFO] [stdout] 230 + self.pages.push(Page([0u8; PAGE_SIZE as usize])); [INFO] [stdout] 231 + self.write.insert(virt_id, write); [INFO] [stdout] 232 + self.exec.insert(virt_id, exec); [INFO] [stdout] 233 + self.pages.get_mut(real_id.0 as usize) [INFO] [stdout] 234 + } else { [INFO] [stdout] 235 + None [INFO] [stdout] 236 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/sim/exec.rs:450:37 [INFO] [stdout] | [INFO] [stdout] 450 | let new_pages = (self.ctx.reg[4] + PAGE_SIZE - 1) / PAGE_SIZE; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `self.ctx.reg[4].div_ceil(PAGE_SIZE)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/sim/mem.rs:326:53 [INFO] [stdout] | [INFO] [stdout] 326 | pub fn dump_page_table(&self, print_stack: bool) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [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/sim/exec.rs:672:9 [INFO] [stdout] | [INFO] [stdout] 672 | / match &self.exn { [INFO] [stdout] 673 | | Some(e) => { [INFO] [stdout] 674 | | return Err(Error::UnhandledException(format!( [INFO] [stdout] 675 | | "Unhandled Exception: {}", [INFO] [stdout] ... | [INFO] [stdout] 702 | | None => {} [INFO] [stdout] 703 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 672 ~ if let Some(e) = &self.exn { [INFO] [stdout] 673 + return Err(Error::UnhandledException(format!( [INFO] [stdout] 674 + "Unhandled Exception: {}", [INFO] [stdout] 675 + match e { [INFO] [stdout] 676 + Exception::Timer => { [INFO] [stdout] 677 + String::from("Unimplemented!?") [INFO] [stdout] 678 + } [INFO] [stdout] 679 + Exception::Overflow => { [INFO] [stdout] 680 + String::from("Overflow exception") [INFO] [stdout] 681 + } [INFO] [stdout] 682 + Exception::Exit(code) => { [INFO] [stdout] 683 + format!("Exit with code {}", code) [INFO] [stdout] 684 + } [INFO] [stdout] 685 + Exception::Syscall(operand) => { [INFO] [stdout] 686 + format!("Syscall with operand {}", operand) [INFO] [stdout] 687 + } [INFO] [stdout] 688 + Exception::DivideByZero => { [INFO] [stdout] 689 + String::from("Divide by zero") [INFO] [stdout] 690 + } [INFO] [stdout] 691 + Exception::Memory(Error::MemoryAccessError(e)) => { [INFO] [stdout] 692 + format!("Memory exception: {}", e) [INFO] [stdout] 693 + } [INFO] [stdout] 694 + Exception::Memory(_) => unreachable!(), [INFO] [stdout] 695 + Exception::Break(operand) => { [INFO] [stdout] 696 + format!("Break with operand {}", operand) [INFO] [stdout] 697 + } [INFO] [stdout] 698 + } [INFO] [stdout] 699 + ))); [INFO] [stdout] 700 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if addr % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 66 | if addr % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:108:12 [INFO] [stdout] | [INFO] [stdout] 108 | if addr % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sim/mem.rs:146:12 [INFO] [stdout] | [INFO] [stdout] 146 | if addr % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `!addr.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/sim/mem.rs:228:9 [INFO] [stdout] | [INFO] [stdout] 228 | / if self.table.contains_key(&virt_id) { [INFO] [stdout] 229 | | None [INFO] [stdout] 230 | | } else { [INFO] [stdout] 231 | | self.table.insert(virt_id, real_id); [INFO] [stdout] ... | [INFO] [stdout] 235 | | self.pages.get_mut(real_id.0 as usize) [INFO] [stdout] 236 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 228 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.table.entry(virt_id) { [INFO] [stdout] 229 + e.insert(real_id); [INFO] [stdout] 230 + self.pages.push(Page([0u8; PAGE_SIZE as usize])); [INFO] [stdout] 231 + self.write.insert(virt_id, write); [INFO] [stdout] 232 + self.exec.insert(virt_id, exec); [INFO] [stdout] 233 + self.pages.get_mut(real_id.0 as usize) [INFO] [stdout] 234 + } else { [INFO] [stdout] 235 + None [INFO] [stdout] 236 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/sim/mem.rs:326:53 [INFO] [stdout] | [INFO] [stdout] 326 | pub fn dump_page_table(&self, print_stack: bool) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 16.87s [INFO] running `Command { std: "docker" "inspect" "e152cc6a8da716300a8dd5036eaae5e6d97e7d5b20d920241f73b56b3900d738", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e152cc6a8da716300a8dd5036eaae5e6d97e7d5b20d920241f73b56b3900d738", kill_on_drop: false }` [INFO] [stdout] e152cc6a8da716300a8dd5036eaae5e6d97e7d5b20d920241f73b56b3900d738