[INFO] cloning repository https://github.com/magniff/ssa-optimizations-primer [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/magniff/ssa-optimizations-primer" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmagniff%2Fssa-optimizations-primer", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmagniff%2Fssa-optimizations-primer'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 0b765c35fe1cb88b56c1c50e75b42ba49ca2deb8 [INFO] linting magniff/ssa-optimizations-primer against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmagniff%2Fssa-optimizations-primer" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/magniff/ssa-optimizations-primer [INFO] finished tweaking git repo https://github.com/magniff/ssa-optimizations-primer [INFO] tweaked toml for git repo https://github.com/magniff/ssa-optimizations-primer written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/magniff/ssa-optimizations-primer 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/magniff/ssa-optimizations-primer 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-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] ab684c152b4a7f8d2b310a9127ea1b8cde3f1535bd86c1a1957f80a73e6b82e6 [INFO] running `Command { std: "docker" "start" "-a" "ab684c152b4a7f8d2b310a9127ea1b8cde3f1535bd86c1a1957f80a73e6b82e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ab684c152b4a7f8d2b310a9127ea1b8cde3f1535bd86c1a1957f80a73e6b82e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ab684c152b4a7f8d2b310a9127ea1b8cde3f1535bd86c1a1957f80a73e6b82e6", kill_on_drop: false }` [INFO] [stdout] ab684c152b4a7f8d2b310a9127ea1b8cde3f1535bd86c1a1957f80a73e6b82e6 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] be2abe3c36efe7d8fce4674cfeba5274dac7f0e9779b0bcc7b98cc7ced5b9737 [INFO] running `Command { std: "docker" "start" "-a" "be2abe3c36efe7d8fce4674cfeba5274dac7f0e9779b0bcc7b98cc7ced5b9737", kill_on_drop: false }` [INFO] [stderr] Checking play-ssa v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/reg/coalesc.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / if let RegVal::Reg(r) = v { [INFO] [stdout] 299 | | if *r == from { [INFO] [stdout] 300 | | *r = to; [INFO] [stdout] 301 | | } [INFO] [stdout] 302 | | } [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] 298 ~ if let RegVal::Reg(r) = v [INFO] [stdout] 299 ~ && *r == from { [INFO] [stdout] 300 | *r = to; [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/reg/coalesc.rs:387:40 [INFO] [stdout] | [INFO] [stdout] 387 | let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 387 - let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] 387 + let candidate = f.blocks.iter().find_map(|b| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SsaBuilder` [INFO] [stdout] --> src/ssa/builder.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / pub fn new() -> Self { [INFO] [stdout] 82 | | SsaBuilder { [INFO] [stdout] 83 | | blocks: Vec::new(), [INFO] [stdout] 84 | | reg_counter: 0, [INFO] [stdout] ... | [INFO] [stdout] 91 | | } [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] 80 + impl Default for SsaBuilder { [INFO] [stdout] 81 + fn default() -> Self { [INFO] [stdout] 82 + Self::new() [INFO] [stdout] 83 + } [INFO] [stdout] 84 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:448:18 [INFO] [stdout] | [INFO] [stdout] 448 | } [INFO] [stdout] | __________________^ [INFO] [stdout] 449 | | .map(|_v| { [INFO] [stdout] ... | [INFO] [stdout] 454 | | _v [INFO] [stdout] 455 | | }) [INFO] [stdout] | |__________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:722:71 [INFO] [stdout] | [INFO] [stdout] 722 | Expr::Block(blk) => self.lower_block_expr(&blk.stmts, cur).map(|(v, b)| (v, b)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/reg/coalesc.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / if let RegVal::Reg(r) = v { [INFO] [stdout] 299 | | if *r == from { [INFO] [stdout] 300 | | *r = to; [INFO] [stdout] 301 | | } [INFO] [stdout] 302 | | } [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] 298 ~ if let RegVal::Reg(r) = v [INFO] [stdout] 299 ~ && *r == from { [INFO] [stdout] 300 | *r = to; [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/reg/coalesc.rs:387:40 [INFO] [stdout] | [INFO] [stdout] 387 | let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 387 - let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] 387 + let candidate = f.blocks.iter().find_map(|b| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ssa/optimization/common.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *t == from { [INFO] [stdout] 83 | | *t = to; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ Terminator::Jump(t) [INFO] [stdout] 82 ~ if *t == from => { [INFO] [stdout] 83 | *t = to; [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SsaBuilder` [INFO] [stdout] --> src/ssa/builder.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / pub fn new() -> Self { [INFO] [stdout] 82 | | SsaBuilder { [INFO] [stdout] 83 | | blocks: Vec::new(), [INFO] [stdout] 84 | | reg_counter: 0, [INFO] [stdout] ... | [INFO] [stdout] 91 | | } [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] 80 + impl Default for SsaBuilder { [INFO] [stdout] 81 + fn default() -> Self { [INFO] [stdout] 82 + Self::new() [INFO] [stdout] 83 + } [INFO] [stdout] 84 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:448:18 [INFO] [stdout] | [INFO] [stdout] 448 | } [INFO] [stdout] | __________________^ [INFO] [stdout] 449 | | .map(|_v| { [INFO] [stdout] ... | [INFO] [stdout] 454 | | _v [INFO] [stdout] 455 | | }) [INFO] [stdout] | |__________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:722:71 [INFO] [stdout] | [INFO] [stdout] 722 | Expr::Block(blk) => self.lower_block_expr(&blk.stmts, cur).map(|(v, b)| (v, b)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ssa/optimization/common.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *t == from { [INFO] [stdout] 83 | | *t = to; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ Terminator::Jump(t) [INFO] [stdout] 82 ~ if *t == from => { [INFO] [stdout] 83 | *t = to; [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ssa/optimization/empty_block_elim.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | let ghosts: Vec = f.blocks.iter().map(|b| is_ghost(b)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_ghost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/inlining.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | / if let Some(callee) = fn_map.get(func) { [INFO] [stdout] 74 | | if callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 | | } [INFO] [stdout] 77 | | } [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] 73 ~ if let Some(callee) = fn_map.get(func) [INFO] [stdout] 74 ~ && callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ssa/optimization/inlining.rs:211:8 [INFO] [stdout] | [INFO] [stdout] 211 | if return_sources.len() != 0 && return_sources.len() != usize::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!return_sources.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: redundant closure [INFO] [stdout] --> src/ssa/optimization/inlining.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | let rv = |vs: &Vec| vs.iter().map(|v| r(v)).collect(); [INFO] [stdout] | ^^^^^^^^ help: replace the closure with the function itself: `&r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / if let SsaVal::Reg(reg) = v { [INFO] [stdout] 70 | | if (*reg as usize) < uses.len() { [INFO] [stdout] 71 | | uses[*reg as usize].push(r); [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 69 ~ if let SsaVal::Reg(reg) = v [INFO] [stdout] 70 ~ && (*reg as usize) < uses.len() { [INFO] [stdout] 71 | uses[*reg as usize].push(r); [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | / if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) { [INFO] [stdout] 150 | | if let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | | return Lattice::Const(result); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) [INFO] [stdout] 150 ~ && let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | return Lattice::Const(result); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ssa/optimization/empty_block_elim.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | let ghosts: Vec = f.blocks.iter().map(|b| is_ghost(b)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_ghost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:264:17 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(dst) = dst_opt { [INFO] [stdout] 265 | | if update_lat(dst, new_lat, &mut lat) || first_visit { [INFO] [stdout] 266 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 267 | | for ur in u { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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 Some(dst) = dst_opt [INFO] [stdout] 265 ~ && (update_lat(dst, new_lat, &mut lat) || first_visit) { [INFO] [stdout] 266 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/inlining.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | / if let Some(callee) = fn_map.get(func) { [INFO] [stdout] 74 | | if callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 | | } [INFO] [stdout] 77 | | } [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] 73 ~ if let Some(callee) = fn_map.get(func) [INFO] [stdout] 74 ~ && callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ssa/optimization/inlining.rs:211:8 [INFO] [stdout] | [INFO] [stdout] 211 | if return_sources.len() != 0 && return_sources.len() != usize::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!return_sources.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: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:357:21 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(dst) = dst_opt { [INFO] [stdout] 358 | | if update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 360 | | for ur2 in u { [INFO] [stdout] ... | [INFO] [stdout] 364 | | } [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] 357 ~ if let Some(dst) = dst_opt [INFO] [stdout] 358 ~ && update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 362 | } [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ssa/optimization/inlining.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | let rv = |vs: &Vec| vs.iter().map(|v| r(v)).collect(); [INFO] [stdout] | ^^^^^^^^ help: replace the closure with the function itself: `&r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/tco.rs:448:13 [INFO] [stdout] | [INFO] [stdout] 448 | / if let SsaInstr::Call { func, args, .. } = instr { [INFO] [stdout] 449 | | if func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | | args.push(extra_arg.clone()); [INFO] [stdout] 451 | | } [INFO] [stdout] 452 | | } [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] 448 ~ if let SsaInstr::Call { func, args, .. } = instr [INFO] [stdout] 449 ~ && func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | args.push(extra_arg.clone()); [INFO] [stdout] 451 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / if let SsaVal::Reg(reg) = v { [INFO] [stdout] 70 | | if (*reg as usize) < uses.len() { [INFO] [stdout] 71 | | uses[*reg as usize].push(r); [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 69 ~ if let SsaVal::Reg(reg) = v [INFO] [stdout] 70 ~ && (*reg as usize) < uses.len() { [INFO] [stdout] 71 | uses[*reg as usize].push(r); [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | / if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) { [INFO] [stdout] 150 | | if let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | | return Lattice::Const(result); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) [INFO] [stdout] 150 ~ && let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | return Lattice::Const(result); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / !live[i] [INFO] [stdout] 40 | | && !(b.phis.is_empty() [INFO] [stdout] 41 | | && b.instrs.is_empty() [INFO] [stdout] 42 | | && matches!(b.term, Terminator::Unreachable) [INFO] [stdout] 43 | | && b.preds.is_empty()) [INFO] [stdout] | |______________________________________^ help: try: `!(live[i] || b.phis.is_empty() && b.instrs.is_empty() && matches!(b.term, Terminator::Unreachable) && b.preds.is_empty())` [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: the loop variable `i` is used to index `live` [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:61:14 [INFO] [stdout] | [INFO] [stdout] 61 | for i in 0..f.blocks.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] 61 - for i in 0..f.blocks.len() { [INFO] [stdout] 61 + for (i, ) in live.iter().enumerate().take(f.blocks.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:264:17 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(dst) = dst_opt { [INFO] [stdout] 265 | | if update_lat(dst, new_lat, &mut lat) || first_visit { [INFO] [stdout] 266 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 267 | | for ur in u { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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 Some(dst) = dst_opt [INFO] [stdout] 265 ~ && (update_lat(dst, new_lat, &mut lat) || first_visit) { [INFO] [stdout] 266 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:357:21 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(dst) = dst_opt { [INFO] [stdout] 358 | | if update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 360 | | for ur2 in u { [INFO] [stdout] ... | [INFO] [stdout] 364 | | } [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] 357 ~ if let Some(dst) = dst_opt [INFO] [stdout] 358 ~ && update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 362 | } [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/mod.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(callee) = fn_map.get(callee_name) { [INFO] [stdout] 125 | | if callee.params.len() > old_arity { [INFO] [stdout] 126 | | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 | | } [INFO] [stdout] 128 | | } [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] 124 ~ if let Some(callee) = fn_map.get(callee_name) [INFO] [stdout] 125 ~ && callee.params.len() > old_arity { [INFO] [stdout] 126 | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/tco.rs:448:13 [INFO] [stdout] | [INFO] [stdout] 448 | / if let SsaInstr::Call { func, args, .. } = instr { [INFO] [stdout] 449 | | if func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | | args.push(extra_arg.clone()); [INFO] [stdout] 451 | | } [INFO] [stdout] 452 | | } [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] 448 ~ if let SsaInstr::Call { func, args, .. } = instr [INFO] [stdout] 449 ~ && func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | args.push(extra_arg.clone()); [INFO] [stdout] 451 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / !live[i] [INFO] [stdout] 40 | | && !(b.phis.is_empty() [INFO] [stdout] 41 | | && b.instrs.is_empty() [INFO] [stdout] 42 | | && matches!(b.term, Terminator::Unreachable) [INFO] [stdout] 43 | | && b.preds.is_empty()) [INFO] [stdout] | |______________________________________^ help: try: `!(live[i] || b.phis.is_empty() && b.instrs.is_empty() && matches!(b.term, Terminator::Unreachable) && b.preds.is_empty())` [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: the loop variable `i` is used to index `live` [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:61:14 [INFO] [stdout] | [INFO] [stdout] 61 | for i in 0..f.blocks.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] 61 - for i in 0..f.blocks.len() { [INFO] [stdout] 61 + for (i, ) in live.iter().enumerate().take(f.blocks.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/mod.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(callee) = fn_map.get(callee_name) { [INFO] [stdout] 125 | | if callee.params.len() > old_arity { [INFO] [stdout] 126 | | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 | | } [INFO] [stdout] 128 | | } [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] 124 ~ if let Some(callee) = fn_map.get(callee_name) [INFO] [stdout] 125 ~ && callee.params.len() > old_arity { [INFO] [stdout] 126 | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/cytron.rs:139:17 [INFO] [stdout] | [INFO] [stdout] 139 | loop_stack: Vec<(BlockId, BlockId, Vec<(FlatVal, BlockId)>)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` 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/bin/cytron.rs:469:9 [INFO] [stdout] | [INFO] [stdout] 469 | / match self.lower_stmts(&fndef.body.stmts, entry) { [INFO] [stdout] 470 | | Some((val, cur)) => self.set_term(cur, FlatTerm::Return(val)), [INFO] [stdout] 471 | | None => {} [INFO] [stdout] 472 | | } [INFO] [stdout] | |_________^ help: try: `if let Some((val, cur)) = self.lower_stmts(&fndef.body.stmts, entry) { self.set_term(cur, FlatTerm::Return(val)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/cytron.rs:139:17 [INFO] [stdout] | [INFO] [stdout] 139 | loop_stack: Vec<(BlockId, BlockId, Vec<(FlatVal, BlockId)>)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `lhs` [INFO] [stdout] --> src/bin/codegen.rs:266:44 [INFO] [stdout] | [INFO] [stdout] 266 | RegInstr::BinOp { dst, op, lhs, .. } => { [INFO] [stdout] | ^^^ help: try ignoring the field: `lhs: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) 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/bin/cytron.rs:469:9 [INFO] [stdout] | [INFO] [stdout] 469 | / match self.lower_stmts(&fndef.body.stmts, entry) { [INFO] [stdout] 470 | | Some((val, cur)) => self.set_term(cur, FlatTerm::Return(val)), [INFO] [stdout] 471 | | None => {} [INFO] [stdout] 472 | | } [INFO] [stdout] | |_________^ help: try: `if let Some((val, cur)) = self.lower_stmts(&fndef.body.stmts, entry) { self.set_term(cur, FlatTerm::Return(val)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `lhs` [INFO] [stdout] --> src/bin/codegen.rs:266:44 [INFO] [stdout] | [INFO] [stdout] 266 | RegInstr::BinOp { dst, op, lhs, .. } => { [INFO] [stdout] | ^^^ help: try ignoring the field: `lhs: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/codegen.rs:1088:59 [INFO] [stdout] | [INFO] [stdout] 1088 | TInstr::Call { args, .. } => args.iter().flat_map(|a| tval_regs(a)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `tval_regs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/codegen.rs:1154:8 [INFO] [stdout] | [INFO] [stdout] 1154 | if total % 16 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `!total.is_multiple_of(16)` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/codegen.rs:1192:9 [INFO] [stdout] | [INFO] [stdout] 1192 | / match tv { [INFO] [stdout] 1193 | | TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1194 | | _ => false, [INFO] [stdout] 1195 | | } [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] 1192 - match tv { [INFO] [stdout] 1193 - TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1194 - _ => false, [INFO] [stdout] 1195 - } [INFO] [stdout] 1192 + matches!(tv, TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/codegen.rs:1259:25 [INFO] [stdout] | [INFO] [stdout] 1259 | / match tv { [INFO] [stdout] 1260 | | TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1261 | | _ => false, [INFO] [stdout] 1262 | | } [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] 1259 - match tv { [INFO] [stdout] 1260 - TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1261 - _ => false, [INFO] [stdout] 1262 - } [INFO] [stdout] 1259 + matches!(tv, TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/codegen.rs:1088:59 [INFO] [stdout] | [INFO] [stdout] 1088 | TInstr::Call { args, .. } => args.iter().flat_map(|a| tval_regs(a)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `tval_regs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/codegen.rs:1580:9 [INFO] [stdout] | [INFO] [stdout] 1580 | / if b.instrs.is_empty() { [INFO] [stdout] 1581 | | if let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | | if t != b.id { [INFO] [stdout] ... | [INFO] [stdout] 1587 | | } [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] 1580 ~ if b.instrs.is_empty() [INFO] [stdout] 1581 ~ && let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | if t != b.id { [INFO] [stdout] ... [INFO] [stdout] 1585 | } [INFO] [stdout] 1586 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/codegen.rs:1581:13 [INFO] [stdout] | [INFO] [stdout] 1581 | / if let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | | if t != b.id { [INFO] [stdout] 1583 | | // avoid trivial self-loops [INFO] [stdout] 1584 | | fwd.insert(b.id, t); [INFO] [stdout] 1585 | | } [INFO] [stdout] 1586 | | } [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] 1581 ~ if let TTerm::Jump(t) = b.term [INFO] [stdout] 1582 ~ && t != b.id { [INFO] [stdout] 1583 | // avoid trivial self-loops [INFO] [stdout] 1584 | fwd.insert(b.id, t); [INFO] [stdout] 1585 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/codegen.rs:1154:8 [INFO] [stdout] | [INFO] [stdout] 1154 | if total % 16 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `!total.is_multiple_of(16)` [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: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/bin/codegen.rs:1633:23 [INFO] [stdout] | [INFO] [stdout] 1633 | for (&dead, _) in &fwd { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 1633 - for (&dead, _) in &fwd { [INFO] [stdout] 1633 + for &dead in fwd.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/codegen.rs:1192:9 [INFO] [stdout] | [INFO] [stdout] 1192 | / match tv { [INFO] [stdout] 1193 | | TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1194 | | _ => false, [INFO] [stdout] 1195 | | } [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] 1192 - match tv { [INFO] [stdout] 1193 - TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1194 - _ => false, [INFO] [stdout] 1195 - } [INFO] [stdout] 1192 + matches!(tv, TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/codegen.rs:1259:25 [INFO] [stdout] | [INFO] [stdout] 1259 | / match tv { [INFO] [stdout] 1260 | | TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1261 | | _ => false, [INFO] [stdout] 1262 | | } [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] 1259 - match tv { [INFO] [stdout] 1260 - TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r) => true, [INFO] [stdout] 1261 - _ => false, [INFO] [stdout] 1262 - } [INFO] [stdout] 1259 + matches!(tv, TVal::Reg(r, _) if !is_preg(*r) && ra.slot.contains_key(r)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/codegen.rs:1580:9 [INFO] [stdout] | [INFO] [stdout] 1580 | / if b.instrs.is_empty() { [INFO] [stdout] 1581 | | if let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | | if t != b.id { [INFO] [stdout] ... | [INFO] [stdout] 1587 | | } [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] 1580 ~ if b.instrs.is_empty() [INFO] [stdout] 1581 ~ && let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | if t != b.id { [INFO] [stdout] ... [INFO] [stdout] 1585 | } [INFO] [stdout] 1586 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/codegen.rs:1581:13 [INFO] [stdout] | [INFO] [stdout] 1581 | / if let TTerm::Jump(t) = b.term { [INFO] [stdout] 1582 | | if t != b.id { [INFO] [stdout] 1583 | | // avoid trivial self-loops [INFO] [stdout] 1584 | | fwd.insert(b.id, t); [INFO] [stdout] 1585 | | } [INFO] [stdout] 1586 | | } [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] 1581 ~ if let TTerm::Jump(t) = b.term [INFO] [stdout] 1582 ~ && t != b.id { [INFO] [stdout] 1583 | // avoid trivial self-loops [INFO] [stdout] 1584 | fwd.insert(b.id, t); [INFO] [stdout] 1585 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/bin/codegen.rs:1633:23 [INFO] [stdout] | [INFO] [stdout] 1633 | for (&dead, _) in &fwd { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 1633 - for (&dead, _) in &fwd { [INFO] [stdout] 1633 + for &dead in fwd.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:5:10 [INFO] [stdout] | [INFO] [stdout] 5 | List(Box), [INFO] [stdout] | ---- ^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Type` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 5 - List(Box), [INFO] [stdout] 5 + List(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Bool`, `Fn`, and `Unit` are never constructed [INFO] [stdout] --> src/ast.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 2 | pub enum Type { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 3 | Int, [INFO] [stdout] 4 | Bool, [INFO] [stdout] | ^^^^ [INFO] [stdout] 5 | List(Box), [INFO] [stdout] 6 | Fn(Vec, Box), [INFO] [stdout] | ^^ [INFO] [stdout] 7 | Unit, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Type` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Ne`, `Lt`, `Le`, `Gt`, `And`, and `Or` are never constructed [INFO] [stdout] --> src/ast.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 20 | pub enum BinOp { [INFO] [stdout] | ----- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 27 | Ne, [INFO] [stdout] | ^^ [INFO] [stdout] 28 | Lt, [INFO] [stdout] | ^^ [INFO] [stdout] 29 | Le, [INFO] [stdout] | ^^ [INFO] [stdout] 30 | Gt, [INFO] [stdout] | ^^ [INFO] [stdout] 31 | Ge, [INFO] [stdout] 32 | And, [INFO] [stdout] | ^^^ [INFO] [stdout] 33 | Or, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BinOp` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Neg` and `Not` are never constructed [INFO] [stdout] --> src/ast.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 38 | pub enum UnOp { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 39 | Neg, [INFO] [stdout] | ^^^ [INFO] [stdout] 40 | Not, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UnOp` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Return` and `Continue` are never constructed [INFO] [stdout] --> src/ast.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 45 | pub enum Stmt { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 57 | Return(Expr), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | Continue, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `UnOp`, `ListExpr`, and `Block` are never constructed [INFO] [stdout] --> src/ast.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 66 | pub enum Expr { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 70 | UnOp(UnOp, Box), [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | ListExpr(Vec), [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 92 | /// A block used as an expression: last stmt that is Expr is the value [INFO] [stdout] 93 | Block(Block), [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Expr` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ret_ty` is never read [INFO] [stdout] --> src/ast.rs:107:9 [INFO] [stdout] | [INFO] [stdout] 104 | pub struct FnDef { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] ... [INFO] [stdout] 107 | pub ret_ty: Type, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FnDef` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `make_sccp_test` is never used [INFO] [stdout] --> src/examples.rs:268:8 [INFO] [stdout] | [INFO] [stdout] 268 | pub fn make_sccp_test() -> Program { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `make_licm_test` is never used [INFO] [stdout] --> src/examples.rs:322:8 [INFO] [stdout] | [INFO] [stdout] 322 | pub fn make_licm_test() -> Program { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/ast.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | ListExpr(Vec), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/reg/coalesc.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / if let RegVal::Reg(r) = v { [INFO] [stdout] 299 | | if *r == from { [INFO] [stdout] 300 | | *r = to; [INFO] [stdout] 301 | | } [INFO] [stdout] 302 | | } [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] 298 ~ if let RegVal::Reg(r) = v [INFO] [stdout] 299 ~ && *r == from { [INFO] [stdout] 300 | *r = to; [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/reg/coalesc.rs:387:40 [INFO] [stdout] | [INFO] [stdout] 387 | let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 387 - let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] 387 + let candidate = f.blocks.iter().find_map(|b| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:5:10 [INFO] [stdout] | [INFO] [stdout] 5 | List(Box), [INFO] [stdout] | ---- ^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Type` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 5 - List(Box), [INFO] [stdout] 5 + List(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Bool`, `Fn`, and `Unit` are never constructed [INFO] [stdout] --> src/ast.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 2 | pub enum Type { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 3 | Int, [INFO] [stdout] 4 | Bool, [INFO] [stdout] | ^^^^ [INFO] [stdout] 5 | List(Box), [INFO] [stdout] 6 | Fn(Vec, Box), [INFO] [stdout] | ^^ [INFO] [stdout] 7 | Unit, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Type` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Ne`, `Lt`, `Le`, `Gt`, `And`, and `Or` are never constructed [INFO] [stdout] --> src/ast.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 20 | pub enum BinOp { [INFO] [stdout] | ----- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 27 | Ne, [INFO] [stdout] | ^^ [INFO] [stdout] 28 | Lt, [INFO] [stdout] | ^^ [INFO] [stdout] 29 | Le, [INFO] [stdout] | ^^ [INFO] [stdout] 30 | Gt, [INFO] [stdout] | ^^ [INFO] [stdout] 31 | Ge, [INFO] [stdout] 32 | And, [INFO] [stdout] | ^^^ [INFO] [stdout] 33 | Or, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BinOp` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Neg` and `Not` are never constructed [INFO] [stdout] --> src/ast.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 38 | pub enum UnOp { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 39 | Neg, [INFO] [stdout] | ^^^ [INFO] [stdout] 40 | Not, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UnOp` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Return` and `Continue` are never constructed [INFO] [stdout] --> src/ast.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 45 | pub enum Stmt { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 57 | Return(Expr), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | Continue, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Stmt` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `UnOp`, `ListExpr`, and `Block` are never constructed [INFO] [stdout] --> src/ast.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 66 | pub enum Expr { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 70 | UnOp(UnOp, Box), [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | ListExpr(Vec), [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 92 | /// A block used as an expression: last stmt that is Expr is the value [INFO] [stdout] 93 | Block(Block), [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Expr` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ret_ty` is never read [INFO] [stdout] --> src/ast.rs:107:9 [INFO] [stdout] | [INFO] [stdout] 104 | pub struct FnDef { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] ... [INFO] [stdout] 107 | pub ret_ty: Type, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FnDef` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `make_sccp_test` is never used [INFO] [stdout] --> src/examples.rs:268:8 [INFO] [stdout] | [INFO] [stdout] 268 | pub fn make_sccp_test() -> Program { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `make_licm_test` is never used [INFO] [stdout] --> src/examples.rs:322:8 [INFO] [stdout] | [INFO] [stdout] 322 | pub fn make_licm_test() -> Program { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/ast.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | ListExpr(Vec), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:448:18 [INFO] [stdout] | [INFO] [stdout] 448 | } [INFO] [stdout] | __________________^ [INFO] [stdout] 449 | | .map(|_v| { [INFO] [stdout] ... | [INFO] [stdout] 454 | | _v [INFO] [stdout] 455 | | }) [INFO] [stdout] | |__________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:722:71 [INFO] [stdout] | [INFO] [stdout] 722 | Expr::Block(blk) => self.lower_block_expr(&blk.stmts, cur).map(|(v, b)| (v, b)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ssa/optimization/common.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *t == from { [INFO] [stdout] 83 | | *t = to; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ Terminator::Jump(t) [INFO] [stdout] 82 ~ if *t == from => { [INFO] [stdout] 83 | *t = to; [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/reg/coalesc.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / if let RegVal::Reg(r) = v { [INFO] [stdout] 299 | | if *r == from { [INFO] [stdout] 300 | | *r = to; [INFO] [stdout] 301 | | } [INFO] [stdout] 302 | | } [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] 298 ~ if let RegVal::Reg(r) = v [INFO] [stdout] 299 ~ && *r == from { [INFO] [stdout] 300 | *r = to; [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/reg/coalesc.rs:387:40 [INFO] [stdout] | [INFO] [stdout] 387 | let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 387 - let candidate = f.blocks.iter().enumerate().find_map(|(_, b)| { [INFO] [stdout] 387 + let candidate = f.blocks.iter().find_map(|b| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ssa/optimization/empty_block_elim.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | let ghosts: Vec = f.blocks.iter().map(|b| is_ghost(b)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_ghost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/inlining.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | / if let Some(callee) = fn_map.get(func) { [INFO] [stdout] 74 | | if callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 | | } [INFO] [stdout] 77 | | } [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] 73 ~ if let Some(callee) = fn_map.get(func) [INFO] [stdout] 74 ~ && callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ssa/optimization/inlining.rs:211:8 [INFO] [stdout] | [INFO] [stdout] 211 | if return_sources.len() != 0 && return_sources.len() != usize::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!return_sources.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: redundant closure [INFO] [stdout] --> src/ssa/optimization/inlining.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | let rv = |vs: &Vec| vs.iter().map(|v| r(v)).collect(); [INFO] [stdout] | ^^^^^^^^ help: replace the closure with the function itself: `&r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / if let SsaVal::Reg(reg) = v { [INFO] [stdout] 70 | | if (*reg as usize) < uses.len() { [INFO] [stdout] 71 | | uses[*reg as usize].push(r); [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 69 ~ if let SsaVal::Reg(reg) = v [INFO] [stdout] 70 ~ && (*reg as usize) < uses.len() { [INFO] [stdout] 71 | uses[*reg as usize].push(r); [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | / if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) { [INFO] [stdout] 150 | | if let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | | return Lattice::Const(result); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) [INFO] [stdout] 150 ~ && let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | return Lattice::Const(result); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:264:17 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(dst) = dst_opt { [INFO] [stdout] 265 | | if update_lat(dst, new_lat, &mut lat) || first_visit { [INFO] [stdout] 266 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 267 | | for ur in u { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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 Some(dst) = dst_opt [INFO] [stdout] 265 ~ && (update_lat(dst, new_lat, &mut lat) || first_visit) { [INFO] [stdout] 266 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:357:21 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(dst) = dst_opt { [INFO] [stdout] 358 | | if update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 360 | | for ur2 in u { [INFO] [stdout] ... | [INFO] [stdout] 364 | | } [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] 357 ~ if let Some(dst) = dst_opt [INFO] [stdout] 358 ~ && update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 362 | } [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:448:18 [INFO] [stdout] | [INFO] [stdout] 448 | } [INFO] [stdout] | __________________^ [INFO] [stdout] 449 | | .map(|_v| { [INFO] [stdout] ... | [INFO] [stdout] 454 | | _v [INFO] [stdout] 455 | | }) [INFO] [stdout] | |__________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/tco.rs:448:13 [INFO] [stdout] | [INFO] [stdout] 448 | / if let SsaInstr::Call { func, args, .. } = instr { [INFO] [stdout] 449 | | if func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | | args.push(extra_arg.clone()); [INFO] [stdout] 451 | | } [INFO] [stdout] 452 | | } [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] 448 ~ if let SsaInstr::Call { func, args, .. } = instr [INFO] [stdout] 449 ~ && func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | args.push(extra_arg.clone()); [INFO] [stdout] 451 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/ssa/builder.rs:722:71 [INFO] [stdout] | [INFO] [stdout] 722 | Expr::Block(blk) => self.lower_block_expr(&blk.stmts, cur).map(|(v, b)| (v, b)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / !live[i] [INFO] [stdout] 40 | | && !(b.phis.is_empty() [INFO] [stdout] 41 | | && b.instrs.is_empty() [INFO] [stdout] 42 | | && matches!(b.term, Terminator::Unreachable) [INFO] [stdout] 43 | | && b.preds.is_empty()) [INFO] [stdout] | |______________________________________^ help: try: `!(live[i] || b.phis.is_empty() && b.instrs.is_empty() && matches!(b.term, Terminator::Unreachable) && b.preds.is_empty())` [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: the loop variable `i` is used to index `live` [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:61:14 [INFO] [stdout] | [INFO] [stdout] 61 | for i in 0..f.blocks.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] 61 - for i in 0..f.blocks.len() { [INFO] [stdout] 61 + for (i, ) in live.iter().enumerate().take(f.blocks.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ssa/optimization/common.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *t == from { [INFO] [stdout] 83 | | *t = to; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ Terminator::Jump(t) [INFO] [stdout] 82 ~ if *t == from => { [INFO] [stdout] 83 | *t = to; [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/mod.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(callee) = fn_map.get(callee_name) { [INFO] [stdout] 125 | | if callee.params.len() > old_arity { [INFO] [stdout] 126 | | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 | | } [INFO] [stdout] 128 | | } [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] 124 ~ if let Some(callee) = fn_map.get(callee_name) [INFO] [stdout] 125 ~ && callee.params.len() > old_arity { [INFO] [stdout] 126 | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/ssa/optimization/empty_block_elim.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | let ghosts: Vec = f.blocks.iter().map(|b| is_ghost(b)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_ghost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/inlining.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | / if let Some(callee) = fn_map.get(func) { [INFO] [stdout] 74 | | if callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 | | } [INFO] [stdout] 77 | | } [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] 73 ~ if let Some(callee) = fn_map.get(func) [INFO] [stdout] 74 ~ && callee.blocks.len() <= INLINE_BLOCK_LIMIT { [INFO] [stdout] 75 | return Some((b.id, ii, func.clone())); [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ssa/optimization/inlining.rs:211:8 [INFO] [stdout] | [INFO] [stdout] 211 | if return_sources.len() != 0 && return_sources.len() != usize::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!return_sources.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: redundant closure [INFO] [stdout] --> src/ssa/optimization/inlining.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | let rv = |vs: &Vec| vs.iter().map(|v| r(v)).collect(); [INFO] [stdout] | ^^^^^^^^ help: replace the closure with the function itself: `&r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / if let SsaVal::Reg(reg) = v { [INFO] [stdout] 70 | | if (*reg as usize) < uses.len() { [INFO] [stdout] 71 | | uses[*reg as usize].push(r); [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 69 ~ if let SsaVal::Reg(reg) = v [INFO] [stdout] 70 ~ && (*reg as usize) < uses.len() { [INFO] [stdout] 71 | uses[*reg as usize].push(r); [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | / if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) { [INFO] [stdout] 150 | | if let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | | return Lattice::Const(result); [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [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] 149 ~ if let (Some(lc), Some(rc)) = (const_val(l), const_val(r)) [INFO] [stdout] 150 ~ && let Some(result) = eval_const_binop(op, lc, rc) { [INFO] [stdout] 151 | return Lattice::Const(result); [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:264:17 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(dst) = dst_opt { [INFO] [stdout] 265 | | if update_lat(dst, new_lat, &mut lat) || first_visit { [INFO] [stdout] 266 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 267 | | for ur in u { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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 Some(dst) = dst_opt [INFO] [stdout] 265 ~ && (update_lat(dst, new_lat, &mut lat) || first_visit) { [INFO] [stdout] 266 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/sccp.rs:357:21 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(dst) = dst_opt { [INFO] [stdout] 358 | | if update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] 360 | | for ur2 in u { [INFO] [stdout] ... | [INFO] [stdout] 364 | | } [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] 357 ~ if let Some(dst) = dst_opt [INFO] [stdout] 358 ~ && update_lat(dst, new_lat, &mut lat) { [INFO] [stdout] 359 | let u = use_lists.get(dst as usize).cloned().unwrap_or_default(); [INFO] [stdout] ... [INFO] [stdout] 362 | } [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/tco.rs:448:13 [INFO] [stdout] | [INFO] [stdout] 448 | / if let SsaInstr::Call { func, args, .. } = instr { [INFO] [stdout] 449 | | if func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | | args.push(extra_arg.clone()); [INFO] [stdout] 451 | | } [INFO] [stdout] 452 | | } [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] 448 ~ if let SsaInstr::Call { func, args, .. } = instr [INFO] [stdout] 449 ~ && func == callee_name && args.len() == old_arity { [INFO] [stdout] 450 | args.push(extra_arg.clone()); [INFO] [stdout] 451 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / !live[i] [INFO] [stdout] 40 | | && !(b.phis.is_empty() [INFO] [stdout] 41 | | && b.instrs.is_empty() [INFO] [stdout] 42 | | && matches!(b.term, Terminator::Unreachable) [INFO] [stdout] 43 | | && b.preds.is_empty()) [INFO] [stdout] | |______________________________________^ help: try: `!(live[i] || b.phis.is_empty() && b.instrs.is_empty() && matches!(b.term, Terminator::Unreachable) && b.preds.is_empty())` [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: the loop variable `i` is used to index `live` [INFO] [stdout] --> src/ssa/optimization/unreachable_block_elim.rs:61:14 [INFO] [stdout] | [INFO] [stdout] 61 | for i in 0..f.blocks.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] 61 - for i in 0..f.blocks.len() { [INFO] [stdout] 61 + for (i, ) in live.iter().enumerate().take(f.blocks.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ssa/optimization/mod.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(callee) = fn_map.get(callee_name) { [INFO] [stdout] 125 | | if callee.params.len() > old_arity { [INFO] [stdout] 126 | | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 | | } [INFO] [stdout] 128 | | } [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] 124 ~ if let Some(callee) = fn_map.get(callee_name) [INFO] [stdout] 125 ~ && callee.params.len() > old_arity { [INFO] [stdout] 126 | f = fixup_accum_callers(f, callee_name, SsaVal::ConstInt(1), old_arity); [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.26s [INFO] running `Command { std: "docker" "inspect" "be2abe3c36efe7d8fce4674cfeba5274dac7f0e9779b0bcc7b98cc7ced5b9737", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "be2abe3c36efe7d8fce4674cfeba5274dac7f0e9779b0bcc7b98cc7ced5b9737", kill_on_drop: false }` [INFO] [stdout] be2abe3c36efe7d8fce4674cfeba5274dac7f0e9779b0bcc7b98cc7ced5b9737