[INFO] cloning repository https://github.com/Lokathor/game_math [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Lokathor/game_math" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLokathor%2Fgame_math", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLokathor%2Fgame_math'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] fac601862e5ebc927f368efe5e11c83330cb13ca [INFO] linting Lokathor/game_math against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLokathor%2Fgame_math" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Lokathor/game_math [INFO] finished tweaking git repo https://github.com/Lokathor/game_math [INFO] tweaked toml for git repo https://github.com/Lokathor/game_math written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Lokathor/game_math 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] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Locking 12 packages to latest Rust 1.96.0-nightly compatible versions [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] Downloading crates ... [INFO] [stderr] Downloaded randomize v5.1.0 [INFO] [stderr] Downloaded contiguous_bitset v0.1.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 5161fea2615023ad29350f9639c111e3c28e96e0e71f5d43de2737c335bf4698 [INFO] running `Command { std: "docker" "start" "-a" "5161fea2615023ad29350f9639c111e3c28e96e0e71f5d43de2737c335bf4698", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "5161fea2615023ad29350f9639c111e3c28e96e0e71f5d43de2737c335bf4698", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5161fea2615023ad29350f9639c111e3c28e96e0e71f5d43de2737c335bf4698", kill_on_drop: false }` [INFO] [stdout] 5161fea2615023ad29350f9639c111e3c28e96e0e71f5d43de2737c335bf4698 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 87c41889d11584c1398498d670d20329f4d852812af262c0a9eb41a2e7a758d1 [INFO] running `Command { std: "docker" "start" "-a" "87c41889d11584c1398498d670d20329f4d852812af262c0a9eb41a2e7a758d1", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.183 [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Compiling bytemuck_derive v1.10.2 [INFO] [stderr] Checking bytemuck v1.25.0 [INFO] [stderr] Checking contiguous_bitset v0.1.2 [INFO] [stderr] Checking randomize v5.1.0 [INFO] [stderr] Checking game_math v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:316:35 [INFO] [stdout] | [INFO] [stdout] 316 | let benefit_of_cover = if !ctx.is_melee [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 317 | | && ctx.defender_has_cover [INFO] [stdout] 318 | | && !(def.armor <= 3 && effective_ap == 0) [INFO] [stdout] 319 | | && !wep.rules.contains(&WeaponRule::IgnoresCover) [INFO] [stdout] | |___________________________________________________________^ help: try: `!(ctx.is_melee || !ctx.defender_has_cover || wep.rules.contains(&WeaponRule::IgnoresCover) || def.armor <= 3 && effective_ap == 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: this `if` statement can be collapsed [INFO] [stdout] --> src/lib.rs:88:3 [INFO] [stdout] | [INFO] [stdout] 88 | / if attacker.any_rule(ModelRule::TacticalPrecision) { [INFO] [stdout] 89 | | if attacker.models.len() > 1 { [INFO] [stdout] 90 | | apply_lt_lethal_hits = true; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if attacker.any_rule(ModelRule::TacticalPrecision) [INFO] [stdout] 89 ~ && attacker.models.len() > 1 { [INFO] [stdout] 90 | apply_lt_lethal_hits = true; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | if non_pistols.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!non_pistols.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: accessing first element with `defender.models.get(0)` [INFO] [stdout] --> src/lib.rs:251:24 [INFO] [stdout] | [INFO] [stdout] 251 | if let Some(m) = defender.models.get(0) { m.toughness } else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `defender.models.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lib.rs:264:7 [INFO] [stdout] | [INFO] [stdout] 264 | / if let WeaponRule::Anti(model_rule, x) = weapon_rule { [INFO] [stdout] 265 | | if defender.models[0].rules.contains(model_rule) { [INFO] [stdout] 266 | | crit_wound_tn = crit_wound_tn.min(*x as i32); [INFO] [stdout] 267 | | } [INFO] [stdout] 268 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 264 ~ if let WeaponRule::Anti(model_rule, x) = weapon_rule [INFO] [stdout] 265 ~ && defender.models[0].rules.contains(model_rule) { [INFO] [stdout] 266 | crit_wound_tn = crit_wound_tn.min(*x as i32); [INFO] [stdout] 267 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `i32` [INFO] [stdout] --> src/lib.rs:329:24 [INFO] [stdout] | [INFO] [stdout] 329 | if save_roll < i32::from(save_tn) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `save_tn` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/lib.rs:423:32 [INFO] [stdout] | [INFO] [stdout] 423 | self.models.iter().any(|m| m.rules.iter().any(|r| *r == rule)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `m.rules.contains(&rule)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/units.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:316:35 [INFO] [stdout] | [INFO] [stdout] 316 | let benefit_of_cover = if !ctx.is_melee [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 317 | | && ctx.defender_has_cover [INFO] [stdout] 318 | | && !(def.armor <= 3 && effective_ap == 0) [INFO] [stdout] 319 | | && !wep.rules.contains(&WeaponRule::IgnoresCover) [INFO] [stdout] | |___________________________________________________________^ help: try: `!(ctx.is_melee || !ctx.defender_has_cover || wep.rules.contains(&WeaponRule::IgnoresCover) || def.armor <= 3 && effective_ap == 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: this `if` statement can be collapsed [INFO] [stdout] --> src/lib.rs:88:3 [INFO] [stdout] | [INFO] [stdout] 88 | / if attacker.any_rule(ModelRule::TacticalPrecision) { [INFO] [stdout] 89 | | if attacker.models.len() > 1 { [INFO] [stdout] 90 | | apply_lt_lethal_hits = true; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if attacker.any_rule(ModelRule::TacticalPrecision) [INFO] [stdout] 89 ~ && attacker.models.len() > 1 { [INFO] [stdout] 90 | apply_lt_lethal_hits = true; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | if non_pistols.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!non_pistols.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: accessing first element with `defender.models.get(0)` [INFO] [stdout] --> src/lib.rs:251:24 [INFO] [stdout] | [INFO] [stdout] 251 | if let Some(m) = defender.models.get(0) { m.toughness } else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `defender.models.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lib.rs:264:7 [INFO] [stdout] | [INFO] [stdout] 264 | / if let WeaponRule::Anti(model_rule, x) = weapon_rule { [INFO] [stdout] 265 | | if defender.models[0].rules.contains(model_rule) { [INFO] [stdout] 266 | | crit_wound_tn = crit_wound_tn.min(*x as i32); [INFO] [stdout] 267 | | } [INFO] [stdout] 268 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 264 ~ if let WeaponRule::Anti(model_rule, x) = weapon_rule [INFO] [stdout] 265 ~ && defender.models[0].rules.contains(model_rule) { [INFO] [stdout] 266 | crit_wound_tn = crit_wound_tn.min(*x as i32); [INFO] [stdout] 267 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `i32` [INFO] [stdout] --> src/lib.rs:329:24 [INFO] [stdout] | [INFO] [stdout] 329 | if save_roll < i32::from(save_tn) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `save_tn` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/lib.rs:423:32 [INFO] [stdout] | [INFO] [stdout] 423 | self.models.iter().any(|m| m.rules.iter().any(|r| *r == rule)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `m.rules.contains(&rule)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [optimized + debuginfo] target(s) in 5.77s [INFO] running `Command { std: "docker" "inspect" "87c41889d11584c1398498d670d20329f4d852812af262c0a9eb41a2e7a758d1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "87c41889d11584c1398498d670d20329f4d852812af262c0a9eb41a2e7a758d1", kill_on_drop: false }` [INFO] [stdout] 87c41889d11584c1398498d670d20329f4d852812af262c0a9eb41a2e7a758d1