[INFO] cloning repository https://github.com/Ianyourgod/c_to_urcl [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Ianyourgod/c_to_urcl" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIanyourgod%2Fc_to_urcl", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIanyourgod%2Fc_to_urcl'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 6fae6ed5961b3c7a58160740001012af46a9a940 [INFO] linting Ianyourgod/c_to_urcl against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIanyourgod%2Fc_to_urcl" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Ianyourgod/c_to_urcl [INFO] finished tweaking git repo https://github.com/Ianyourgod/c_to_urcl [INFO] tweaked toml for git repo https://github.com/Ianyourgod/c_to_urcl written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Ianyourgod/c_to_urcl 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/Ianyourgod/c_to_urcl already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 3ff0254ea05592123d8783d87e1f5e14ae74d420877ea07db93ca2d5d85ff2e1 [INFO] running `Command { std: "docker" "start" "-a" "3ff0254ea05592123d8783d87e1f5e14ae74d420877ea07db93ca2d5d85ff2e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3ff0254ea05592123d8783d87e1f5e14ae74d420877ea07db93ca2d5d85ff2e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3ff0254ea05592123d8783d87e1f5e14ae74d420877ea07db93ca2d5d85ff2e1", kill_on_drop: false }` [INFO] [stdout] 3ff0254ea05592123d8783d87e1f5e14ae74d420877ea07db93ca2d5d85ff2e1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 22c8043d36e554ad4e6365e28a77cf1c09d3bf16812563288627ad268876dae1 [INFO] running `Command { std: "docker" "start" "-a" "22c8043d36e554ad4e6365e28a77cf1c09d3bf16812563288627ad268876dae1", kill_on_drop: false }` [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling libc v0.2.174 [INFO] [stderr] Compiling rustversion v1.0.21 [INFO] [stderr] Compiling regex-syntax v0.8.5 [INFO] [stderr] Compiling cfg-if v1.0.1 [INFO] [stderr] Compiling hashbrown v0.15.4 [INFO] [stderr] Compiling term v1.1.0 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling parking_lot_core v0.9.11 [INFO] [stderr] Compiling lock_api v0.4.13 [INFO] [stderr] Compiling ena v0.14.3 [INFO] [stderr] Checking indexmap v2.10.0 [INFO] [stderr] Compiling ascii-canvas v4.0.0 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling parking_lot v0.12.4 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling string_cache v0.8.9 [INFO] [stderr] Compiling digest v0.10.7 [INFO] [stderr] Compiling sha3 v0.10.8 [INFO] [stderr] Compiling petgraph v0.7.1 [INFO] [stderr] Compiling regex-automata v0.4.9 [INFO] [stderr] Checking lalrpop-util v0.22.2 [INFO] [stderr] Compiling regex v1.11.1 [INFO] [stderr] Compiling lalrpop v0.22.2 [INFO] [stderr] Compiling c_to_urcl v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/semantic_analysis/type_check.rs:736:51 [INFO] [stdout] | [INFO] [stdout] 736 | let attrs = IdentifierAttrs::Static { init: init, global: false }; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `init` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/semantic_analysis/type_check.rs:736:51 [INFO] [stdout] | [INFO] [stdout] 736 | let attrs = IdentifierAttrs::Static { init: init, global: false }; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `init` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/ast.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | / match self { [INFO] [stdout] 261 | | BinOp::Add | BinOp::Sub | [INFO] [stdout] 262 | | BinOp::Mul | BinOp::Div | [INFO] [stdout] 263 | | BinOp::Mod => true, [INFO] [stdout] 264 | | [INFO] [stdout] 265 | | _ => false [INFO] [stdout] 266 | | } [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] 260 ~ matches!(self, BinOp::Add | BinOp::Sub | [INFO] [stdout] 261 + BinOp::Mul | BinOp::Div | [INFO] [stdout] 262 + BinOp::Mod) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ast.rs:313:12 [INFO] [stdout] | [INFO] [stdout] 313 | if specifiers.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `specifiers.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 `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:322:60 [INFO] [stdout] | [INFO] [stdout] 322 | let struct_tag = if let Specifier::Struct(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.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: accessing first element with `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | let union_tag = if let Specifier::Union(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:342:56 [INFO] [stdout] | [INFO] [stdout] 342 | let enum_tag = if let Specifier::Enum(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:393:34 [INFO] [stdout] | [INFO] [stdout] 393 | if left_ty.is_signed() { return right_ty.clone(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 393 - if left_ty.is_signed() { return right_ty.clone(); } [INFO] [stdout] 393 + if left_ty.is_signed() { right_ty.clone()} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:394:35 [INFO] [stdout] | [INFO] [stdout] 394 | else { return left_ty.clone(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 394 - else { return left_ty.clone(); } [INFO] [stdout] 394 + else { left_ty.clone()} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast.rs:437:25 [INFO] [stdout] | [INFO] [stdout] 437 | pub fn refed_ptr_ty<'a>(&'a self) -> Option<&'a Type> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 437 - pub fn refed_ptr_ty<'a>(&'a self) -> Option<&'a Type> { [INFO] [stdout] 437 + pub fn refed_ptr_ty(&self) -> Option<&Type> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/ast.rs:449:9 [INFO] [stdout] | [INFO] [stdout] 449 | / match self { [INFO] [stdout] 450 | | Self::Void | [INFO] [stdout] 451 | | Self::Array(_, _) | [INFO] [stdout] 452 | | Self::Struct(_) | [INFO] [stdout] ... | [INFO] [stdout] 456 | | _ => true, [INFO] [stdout] 457 | | } [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] 449 ~ !matches!(self, Self::Void | [INFO] [stdout] 450 + Self::Array(_, _) | [INFO] [stdout] 451 + Self::Struct(_) | [INFO] [stdout] 452 + Self::Union(_) | [INFO] [stdout] 453 + Self::Fn { .. }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:475:9 [INFO] [stdout] | [INFO] [stdout] 475 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 475 - return true; [INFO] [stdout] 475 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `as_*` usually take `self` by reference or `self` by mutable reference [INFO] [stdout] --> src/ast.rs:779:19 [INFO] [stdout] | [INFO] [stdout] 779 | pub fn as_i32(self) -> i32 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:133:38 [INFO] [stdout] | [INFO] [stdout] 133 | let unique_tag = if let Some(ref old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 133 - let unique_tag = if let Some(ref old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 133 + let unique_tag = if let Some(old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:150:38 [INFO] [stdout] | [INFO] [stdout] 150 | let unique_tag = if let Some(ref old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - let unique_tag = if let Some(ref old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 150 + let unique_tag = if let Some(old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | let unique_tag = if let Some(ref old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 167 - let unique_tag = if let Some(ref old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 167 + let unique_tag = if let Some(old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/semantic_analysis/loop_label.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | function.block.as_mut().map(|b|self.label_block(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 39 - function.block.as_mut().map(|b|self.label_block(b)); [INFO] [stdout] 39 + if let Some(b) = function.block.as_mut() { self.label_block(b) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/loop_label.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | return label; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 - return label; [INFO] [stdout] 58 + label [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/ast.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | / match self { [INFO] [stdout] 261 | | BinOp::Add | BinOp::Sub | [INFO] [stdout] 262 | | BinOp::Mul | BinOp::Div | [INFO] [stdout] 263 | | BinOp::Mod => true, [INFO] [stdout] 264 | | [INFO] [stdout] 265 | | _ => false [INFO] [stdout] 266 | | } [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] 260 ~ matches!(self, BinOp::Add | BinOp::Sub | [INFO] [stdout] 261 + BinOp::Mul | BinOp::Div | [INFO] [stdout] 262 + BinOp::Mod) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ast.rs:313:12 [INFO] [stdout] | [INFO] [stdout] 313 | if specifiers.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `specifiers.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 `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:322:60 [INFO] [stdout] | [INFO] [stdout] 322 | let struct_tag = if let Specifier::Struct(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.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: accessing first element with `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | let union_tag = if let Specifier::Union(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `specifiers.get(0)` [INFO] [stdout] --> src/ast.rs:342:56 [INFO] [stdout] | [INFO] [stdout] 342 | let enum_tag = if let Specifier::Enum(t) = specifiers.get(0).unwrap() { t } else { unreachable!() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `specifiers.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:393:34 [INFO] [stdout] | [INFO] [stdout] 393 | if left_ty.is_signed() { return right_ty.clone(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 393 - if left_ty.is_signed() { return right_ty.clone(); } [INFO] [stdout] 393 + if left_ty.is_signed() { right_ty.clone()} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:394:35 [INFO] [stdout] | [INFO] [stdout] 394 | else { return left_ty.clone(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 394 - else { return left_ty.clone(); } [INFO] [stdout] 394 + else { left_ty.clone()} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast.rs:437:25 [INFO] [stdout] | [INFO] [stdout] 437 | pub fn refed_ptr_ty<'a>(&'a self) -> Option<&'a Type> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 437 - pub fn refed_ptr_ty<'a>(&'a self) -> Option<&'a Type> { [INFO] [stdout] 437 + pub fn refed_ptr_ty(&self) -> Option<&Type> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/ast.rs:449:9 [INFO] [stdout] | [INFO] [stdout] 449 | / match self { [INFO] [stdout] 450 | | Self::Void | [INFO] [stdout] 451 | | Self::Array(_, _) | [INFO] [stdout] 452 | | Self::Struct(_) | [INFO] [stdout] ... | [INFO] [stdout] 456 | | _ => true, [INFO] [stdout] 457 | | } [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] 449 ~ !matches!(self, Self::Void | [INFO] [stdout] 450 + Self::Array(_, _) | [INFO] [stdout] 451 + Self::Struct(_) | [INFO] [stdout] 452 + Self::Union(_) | [INFO] [stdout] 453 + Self::Fn { .. }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast.rs:475:9 [INFO] [stdout] | [INFO] [stdout] 475 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 475 - return true; [INFO] [stdout] 475 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::IndexMap, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:217:22 [INFO] [stdout] | [INFO] [stdout] 217 | members: members.into() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `members` [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: useless conversion to the same type: `indexmap::IndexMap, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:264:22 [INFO] [stdout] | [INFO] [stdout] 264 | members: members.into() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `members` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `as_*` usually take `self` by reference or `self` by mutable reference [INFO] [stdout] --> src/ast.rs:779:19 [INFO] [stdout] | [INFO] [stdout] 779 | pub fn as_i32(self) -> i32 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:442:61 [INFO] [stdout] | [INFO] [stdout] 442 | for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 442 - for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] 442 + for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:464:61 [INFO] [stdout] | [INFO] [stdout] 464 | for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 464 - for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] 464 + for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:560:75 [INFO] [stdout] | [INFO] [stdout] 560 | let inits = self.compound_init_to_static_inits_rec(inits, &inner_ty); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `inner_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:133:38 [INFO] [stdout] | [INFO] [stdout] 133 | let unique_tag = if let Some(ref old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 133 - let unique_tag = if let Some(ref old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 133 + let unique_tag = if let Some(old_entry) = context.struct_map.get(&struct_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:561:41 [INFO] [stdout] | [INFO] [stdout] 561 | inits.into_iter().chain(std::iter::repeat(StaticInit::ZeroInit).take(needed_zeros)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(StaticInit::ZeroInit, needed_zeros)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:150:38 [INFO] [stdout] | [INFO] [stdout] 150 | let unique_tag = if let Some(ref old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - let unique_tag = if let Some(ref old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 150 + let unique_tag = if let Some(old_entry) = context.union_map.get(&union_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/semantic_analysis/name_analysis.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | let unique_tag = if let Some(ref old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 167 - let unique_tag = if let Some(ref old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] 167 + let unique_tag = if let Some(old_entry) = context.enum_map.get(&enum_decl.name) && old_entry.from_this_scope { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:598:94 [INFO] [stdout] | [INFO] [stdout] 598 | ... let extra = if extra_needed >= 0 { std::iter::repeat_n(self.static_zero_init(&inner_ty).into_iter().next().unwrap(), extra_ne... [INFO] [stdout] | ^^^^^^^^^ help: change this to: `inner_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:601:28 [INFO] [stdout] | [INFO] [stdout] 601 | out.extend(extra.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 601 - out.extend(extra.into_iter()); [INFO] [stdout] 601 + out.extend(extra); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:660:45 [INFO] [stdout] | [INFO] [stdout] 660 | inits.into_iter().chain(std::iter::repeat(StaticInit::ZeroInit).take(needed_zeros)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(StaticInit::ZeroInit, needed_zeros)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/semantic_analysis/type_check.rs:673:22 [INFO] [stdout] | [INFO] [stdout] 673 | .flat_map(|i|i) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/semantic_analysis/type_check.rs:708:12 [INFO] [stdout] | [INFO] [stdout] 708 | ...if !var_decl.ty.is_complete(&self.type_table) && !(var_decl.storage_class == Some(ast::StorageClass::Extern) && var_decl.expr.is_none()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(var_decl.ty.is_complete(&self.type_table) || var_decl.storage_class == Some(ast::StorageClass::Extern) && var_decl.expr.is_none())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/type_check.rs:747:9 [INFO] [stdout] | [INFO] [stdout] 747 | return ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 747 - return ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class); [INFO] [stdout] 747 + ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::map::Values<'_, std::rc::Rc, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:796:29 [INFO] [stdout] | [INFO] [stdout] 796 | let zeros = struct_def.members.values().into_iter().skip(inits_len).map(|entry| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `struct_def.members.values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::map::Values<'_, std::rc::Rc, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:800:28 [INFO] [stdout] | [INFO] [stdout] 800 | ... let vals = struct_def.members.values().into_iter().map(|m|m.ty.clone()).collect::>().into_iter(); // this is some bull... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `struct_def.members.values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/semantic_analysis/loop_label.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | function.block.as_mut().map(|b|self.label_block(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 39 - function.block.as_mut().map(|b|self.label_block(b)); [INFO] [stdout] 39 + if let Some(b) = function.block.as_mut() { self.label_block(b) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/loop_label.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | return label; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 - return label; [INFO] [stdout] 58 + label [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:834:58 [INFO] [stdout] | [INFO] [stdout] 834 | ...>>().into_iter().chain(std::iter::repeat(self.zero_init(inner_ty.as_ref())).take(extra_needed)).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(self.zero_init(inner_ty.as_ref()), extra_needed)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:849:44 [INFO] [stdout] | [INFO] [stdout] 849 | ast::Initializer::Compound(std::iter::repeat(self.zero_init(ty.as_ref())).take(*len as usize).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(self.zero_init(ty.as_ref()), *len as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::IndexMap, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:217:22 [INFO] [stdout] | [INFO] [stdout] 217 | members: members.into() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `members` [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: useless conversion to the same type: `indexmap::IndexMap, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:264:22 [INFO] [stdout] | [INFO] [stdout] 264 | members: members.into() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `members` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:442:61 [INFO] [stdout] | [INFO] [stdout] 442 | for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 442 - for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] 442 + for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:464:61 [INFO] [stdout] | [INFO] [stdout] 464 | for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 464 - for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>().into_iter()) { [INFO] [stdout] 464 + for (init, member) in inits.into_iter().zip(decl.members.values().cloned().collect::>()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1382:46 [INFO] [stdout] | [INFO] [stdout] 1382 | self.validate_type_specifier(&inner); [INFO] [stdout] | ^^^^^^ help: change this to: `inner` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1385:46 [INFO] [stdout] | [INFO] [stdout] 1385 | self.validate_type_specifier(&inner); [INFO] [stdout] | ^^^^^^ help: change this to: `inner` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1391:46 [INFO] [stdout] | [INFO] [stdout] 1391 | self.validate_type_specifier(&ret_ty); [INFO] [stdout] | ^^^^^^^ help: change this to: `ret_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:560:75 [INFO] [stdout] | [INFO] [stdout] 560 | let inits = self.compound_init_to_static_inits_rec(inits, &inner_ty); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `inner_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:561:41 [INFO] [stdout] | [INFO] [stdout] 561 | inits.into_iter().chain(std::iter::repeat(StaticInit::ZeroInit).take(needed_zeros)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(StaticInit::ZeroInit, needed_zeros)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1415:9 [INFO] [stdout] | [INFO] [stdout] 1415 | return TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1415 - return TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] 1415 + TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1421:17 [INFO] [stdout] | [INFO] [stdout] 1421 | / match c { [INFO] [stdout] 1422 | | ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] 1424 | | _ => false, [INFO] [stdout] 1425 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1420:35 [INFO] [stdout] | [INFO] [stdout] 1420 | DefaultExpr::Constant(ref c) => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1421 | match c { [INFO] [stdout] 1422 | / ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] | |_______________________________________^ with this pattern [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] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1421:17 [INFO] [stdout] | [INFO] [stdout] 1421 | / match c { [INFO] [stdout] 1422 | | ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] 1424 | | _ => false, [INFO] [stdout] 1425 | | } [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] 1421 ~ matches!(c, ast::Const::Int(0) | [INFO] [stdout] 1422 + ast::Const::UInt(0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:598:94 [INFO] [stdout] | [INFO] [stdout] 598 | ... let extra = if extra_needed >= 0 { std::iter::repeat_n(self.static_zero_init(&inner_ty).into_iter().next().unwrap(), extra_ne... [INFO] [stdout] | ^^^^^^^^^ help: change this to: `inner_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:601:28 [INFO] [stdout] | [INFO] [stdout] 601 | out.extend(extra.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 601 - out.extend(extra.into_iter()); [INFO] [stdout] 601 + out.extend(extra); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:660:45 [INFO] [stdout] | [INFO] [stdout] 660 | inits.into_iter().chain(std::iter::repeat(StaticInit::ZeroInit).take(needed_zeros)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(StaticInit::ZeroInit, needed_zeros)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/semantic_analysis/type_check.rs:673:22 [INFO] [stdout] | [INFO] [stdout] 673 | .flat_map(|i|i) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/semantic_analysis/type_check.rs:708:12 [INFO] [stdout] | [INFO] [stdout] 708 | ...if !var_decl.ty.is_complete(&self.type_table) && !(var_decl.storage_class == Some(ast::StorageClass::Extern) && var_decl.expr.is_none()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(var_decl.ty.is_complete(&self.type_table) || var_decl.storage_class == Some(ast::StorageClass::Extern) && var_decl.expr.is_none())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/type_check.rs:747:9 [INFO] [stdout] | [INFO] [stdout] 747 | return ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 747 - return ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class); [INFO] [stdout] 747 + ast::VarDeclaration::new(var_decl.name, var_decl.ty, expr, var_decl.storage_class) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CFG` contains a capitalized acronym [INFO] [stdout] --> src/mir/mir_def.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | pub struct CFG { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cfg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::hash_map::Keys<'_, mir::mir_def::BlockID, mir::mir_def::BasicBlock>` [INFO] [stdout] --> src/mir/mir_def.rs:71:19 [INFO] [stdout] | [INFO] [stdout] 71 | for id in self.blocks.keys().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `self.blocks.keys()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::map::Values<'_, std::rc::Rc, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:796:29 [INFO] [stdout] | [INFO] [stdout] 796 | let zeros = struct_def.members.values().into_iter().skip(inits_len).map(|entry| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `struct_def.members.values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `indexmap::map::Values<'_, std::rc::Rc, semantic_analysis::type_check::MemberEntry>` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:800:28 [INFO] [stdout] | [INFO] [stdout] 800 | ... let vals = struct_def.members.values().into_iter().map(|m|m.ty.clone()).collect::>().into_iter(); // this is some bull... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `struct_def.members.values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:834:58 [INFO] [stdout] | [INFO] [stdout] 834 | ...>>().into_iter().chain(std::iter::repeat(self.zero_init(inner_ty.as_ref())).take(extra_needed)).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(self.zero_init(inner_ty.as_ref()), extra_needed)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/semantic_analysis/type_check.rs:849:44 [INFO] [stdout] | [INFO] [stdout] 849 | ast::Initializer::Compound(std::iter::repeat(self.zero_init(ty.as_ref())).take(*len as usize).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(self.zero_init(ty.as_ref()), *len as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/mir/mir_gen.rs:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | ... (0..len).into_iter().flat_map(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/mir/mir_gen.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | ... std::iter::repeat(mir_def::StaticInit::ZeroInit).take(size as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(mir_def::StaticInit::ZeroInit, size as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/mir/mir_gen.rs:229:17 [INFO] [stdout] | [INFO] [stdout] 229 | s.chars().into_iter().for_each(|c| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1382:46 [INFO] [stdout] | [INFO] [stdout] 1382 | self.validate_type_specifier(&inner); [INFO] [stdout] | ^^^^^^ help: change this to: `inner` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1385:46 [INFO] [stdout] | [INFO] [stdout] 1385 | self.validate_type_specifier(&inner); [INFO] [stdout] | ^^^^^^ help: change this to: `inner` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1391:46 [INFO] [stdout] | [INFO] [stdout] 1391 | self.validate_type_specifier(&ret_ty); [INFO] [stdout] | ^^^^^^^ help: change this to: `ret_ty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1415:9 [INFO] [stdout] | [INFO] [stdout] 1415 | return TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1415 - return TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] 1415 + TypedExpr::new(DefaultExpr::Cast(ty.clone(), Box::new(expr)), ty.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1421:17 [INFO] [stdout] | [INFO] [stdout] 1421 | / match c { [INFO] [stdout] 1422 | | ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] 1424 | | _ => false, [INFO] [stdout] 1425 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1420:35 [INFO] [stdout] | [INFO] [stdout] 1420 | DefaultExpr::Constant(ref c) => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1421 | match c { [INFO] [stdout] 1422 | / ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] | |_______________________________________^ with this pattern [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] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/semantic_analysis/type_check.rs:1421:17 [INFO] [stdout] | [INFO] [stdout] 1421 | / match c { [INFO] [stdout] 1422 | | ast::Const::Int(0) | [INFO] [stdout] 1423 | | ast::Const::UInt(0) => true, [INFO] [stdout] 1424 | | _ => false, [INFO] [stdout] 1425 | | } [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] 1421 ~ matches!(c, ast::Const::Int(0) | [INFO] [stdout] 1422 + ast::Const::UInt(0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CFG` contains a capitalized acronym [INFO] [stdout] --> src/mir/mir_def.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | pub struct CFG { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cfg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::hash_map::Keys<'_, mir::mir_def::BlockID, mir::mir_def::BasicBlock>` [INFO] [stdout] --> src/mir/mir_def.rs:71:19 [INFO] [stdout] | [INFO] [stdout] 71 | for id in self.blocks.keys().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `self.blocks.keys()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:29:25 [INFO] [stdout] | [INFO] [stdout] 29 | f.write_str(¶m)?; [INFO] [stdout] | ^^^^^^ help: change this to: `param` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/mir/mir_gen.rs:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | ... (0..len).into_iter().flat_map(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/mir/pretty_print.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if start.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!start.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/mir/mir_gen.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | ... std::iter::repeat(mir_def::StaticInit::ZeroInit).take(size as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(mir_def::StaticInit::ZeroInit, size as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `start` [INFO] [stdout] --> src/mir/pretty_print.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | let start = start; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `start` is initially defined here [INFO] [stdout] --> src/mir/pretty_print.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | let start = self.blocks.get(&mir_def::BlockID::Start).unwrap().get_successors(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` 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/mir/pretty_print.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / match block { [INFO] [stdout] 50 | | mir_def::BasicBlock::Generic(block) => block.fmt(f)?, [INFO] [stdout] 51 | | _ => () [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ help: try: `if let mir_def::BasicBlock::Generic(block) = block { block.fmt(f)? }` [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: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/mir/mir_gen.rs:229:17 [INFO] [stdout] | [INFO] [stdout] 229 | s.chars().into_iter().for_each(|c| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:140:29 [INFO] [stdout] | [INFO] [stdout] 140 | f.write_str(&name)?; [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:162:49 [INFO] [stdout] | [INFO] [stdout] 162 | mir_def::Val::Var(v) => f.write_str(&v) [INFO] [stdout] | ^^ help: change this to: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/mir/optimizations/pointer_analysis.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | / match block { [INFO] [stdout] 15 | | mir_def::BasicBlock::Generic(block) => { [INFO] [stdout] 16 | | block.instructions.iter().for_each(|instr| { [INFO] [stdout] 17 | | match &instr.instr { [INFO] [stdout] ... | [INFO] [stdout] 25 | | _ => () [INFO] [stdout] 26 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ if let mir_def::BasicBlock::Generic(block) = block { [INFO] [stdout] 15 + block.instructions.iter().for_each(|instr| { [INFO] [stdout] 16 + match &instr.instr { [INFO] [stdout] 17 + mir_def::Instruction::GetAddress { src, .. } => { [INFO] [stdout] 18 + aliased.insert(src); [INFO] [stdout] 19 + }, [INFO] [stdout] 20 + _ => () [INFO] [stdout] 21 + } [INFO] [stdout] 22 + }) [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/mir/optimizations/pointer_analysis.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | / match &instr.instr { [INFO] [stdout] 18 | | mir_def::Instruction::GetAddress { src, .. } => { [INFO] [stdout] 19 | | aliased.insert(src); [INFO] [stdout] 20 | | }, [INFO] [stdout] 21 | | _ => () [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 17 ~ if let mir_def::Instruction::GetAddress { src, .. } = &instr.instr { [INFO] [stdout] 18 + aliased.insert(src); [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 94 | | !(copy.src == dst_as_val || copy.dst == *dst) [INFO] [stdout] 95 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 93 ~ current_copies.retain(|copy| { [INFO] [stdout] 94 + !(copy.src == dst_as_val || copy.dst == *dst) [INFO] [stdout] 95 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:108:21 [INFO] [stdout] | [INFO] [stdout] 108 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 109 | | !( [INFO] [stdout] 110 | | self.is_aliased(©.src) || [INFO] [stdout] 111 | | self.is_v_aliased(©.dst) || [INFO] [stdout] ... | [INFO] [stdout] 118 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 108 ~ current_copies.retain(|copy| { [INFO] [stdout] 109 + !( [INFO] [stdout] 110 + self.is_aliased(©.src) || [INFO] [stdout] 111 + self.is_v_aliased(©.dst) || [INFO] [stdout] 112 + if let Some(dst) = dst { [INFO] [stdout] 113 + copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 114 + copy.dst == *dst [INFO] [stdout] 115 + } else { false } [INFO] [stdout] 116 + [INFO] [stdout] 117 + ) [INFO] [stdout] 118 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 122 | | !(self.is_aliased(©.src) || self.is_v_aliased(©.dst)) [INFO] [stdout] 123 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 121 ~ current_copies.retain(|copy| { [INFO] [stdout] 122 + !(self.is_aliased(©.src) || self.is_v_aliased(©.dst)) [INFO] [stdout] 123 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:133:21 [INFO] [stdout] | [INFO] [stdout] 133 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 134 | | !( [INFO] [stdout] 135 | | copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 136 | | copy.dst == *dst [INFO] [stdout] 137 | | ) [INFO] [stdout] 138 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 133 ~ current_copies.retain(|copy| { [INFO] [stdout] 134 + !( [INFO] [stdout] 135 + copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 136 + copy.dst == *dst [INFO] [stdout] 137 + ) [INFO] [stdout] 138 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:163:38 [INFO] [stdout] | [INFO] [stdout] 163 | fn intersection(a: Vec, b: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 163 - fn intersection(a: Vec, b: &Vec) -> Vec { [INFO] [stdout] 163 + fn intersection(a: Vec, b: &[Copy]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:29:25 [INFO] [stdout] | [INFO] [stdout] 29 | f.write_str(¶m)?; [INFO] [stdout] | ^^^^^^ help: change this to: `param` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/mir/pretty_print.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if start.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!start.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:259:36 [INFO] [stdout] | [INFO] [stdout] 259 | if let Some(copy) = copies.into_iter().find(|c|c.dst==*v) { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `start` [INFO] [stdout] --> src/mir/pretty_print.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | let start = start; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `start` is initially defined here [INFO] [stdout] --> src/mir/pretty_print.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | let start = self.blocks.get(&mir_def::BlockID::Start).unwrap().get_successors(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` 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/mir/pretty_print.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / match block { [INFO] [stdout] 50 | | mir_def::BasicBlock::Generic(block) => block.fmt(f)?, [INFO] [stdout] 51 | | _ => () [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ help: try: `if let mir_def::BasicBlock::Generic(block) = block { block.fmt(f)? }` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:140:29 [INFO] [stdout] | [INFO] [stdout] 140 | f.write_str(&name)?; [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/pretty_print.rs:162:49 [INFO] [stdout] | [INFO] [stdout] 162 | mir_def::Val::Var(v) => f.write_str(&v) [INFO] [stdout] | ^^ help: change this to: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/mir/optimizations/pointer_analysis.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | / match block { [INFO] [stdout] 15 | | mir_def::BasicBlock::Generic(block) => { [INFO] [stdout] 16 | | block.instructions.iter().for_each(|instr| { [INFO] [stdout] 17 | | match &instr.instr { [INFO] [stdout] ... | [INFO] [stdout] 25 | | _ => () [INFO] [stdout] 26 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ if let mir_def::BasicBlock::Generic(block) = block { [INFO] [stdout] 15 + block.instructions.iter().for_each(|instr| { [INFO] [stdout] 16 + match &instr.instr { [INFO] [stdout] 17 + mir_def::Instruction::GetAddress { src, .. } => { [INFO] [stdout] 18 + aliased.insert(src); [INFO] [stdout] 19 + }, [INFO] [stdout] 20 + _ => () [INFO] [stdout] 21 + } [INFO] [stdout] 22 + }) [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/mir/optimizations/pointer_analysis.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | / match &instr.instr { [INFO] [stdout] 18 | | mir_def::Instruction::GetAddress { src, .. } => { [INFO] [stdout] 19 | | aliased.insert(src); [INFO] [stdout] 20 | | }, [INFO] [stdout] 21 | | _ => () [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 17 ~ if let mir_def::Instruction::GetAddress { src, .. } = &instr.instr { [INFO] [stdout] 18 + aliased.insert(src); [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/optimizations/dead_store.rs:217:54 [INFO] [stdout] | [INFO] [stdout] 217 | let predecessor = cfg.blocks.get(&predecessor).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `predecessor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/dead_store.rs:247:9 [INFO] [stdout] | [INFO] [stdout] 247 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return false; [INFO] [stdout] 247 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 94 | | !(copy.src == dst_as_val || copy.dst == *dst) [INFO] [stdout] 95 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 93 ~ current_copies.retain(|copy| { [INFO] [stdout] 94 + !(copy.src == dst_as_val || copy.dst == *dst) [INFO] [stdout] 95 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:108:21 [INFO] [stdout] | [INFO] [stdout] 108 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 109 | | !( [INFO] [stdout] 110 | | self.is_aliased(©.src) || [INFO] [stdout] 111 | | self.is_v_aliased(©.dst) || [INFO] [stdout] ... | [INFO] [stdout] 118 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 108 ~ current_copies.retain(|copy| { [INFO] [stdout] 109 + !( [INFO] [stdout] 110 + self.is_aliased(©.src) || [INFO] [stdout] 111 + self.is_v_aliased(©.dst) || [INFO] [stdout] 112 + if let Some(dst) = dst { [INFO] [stdout] 113 + copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 114 + copy.dst == *dst [INFO] [stdout] 115 + } else { false } [INFO] [stdout] 116 + [INFO] [stdout] 117 + ) [INFO] [stdout] 118 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 122 | | !(self.is_aliased(©.src) || self.is_v_aliased(©.dst)) [INFO] [stdout] 123 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 121 ~ current_copies.retain(|copy| { [INFO] [stdout] 122 + !(self.is_aliased(©.src) || self.is_v_aliased(©.dst)) [INFO] [stdout] 123 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mir/optimizations/inlining.rs:181:17 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Some(item) = self.fns.get(only) { [INFO] [stdout] 182 | | if item.successors.contains(only) { [INFO] [stdout] 183 | | self.recursive.insert(only.clone()); [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [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] 181 ~ if let Some(item) = self.fns.get(only) [INFO] [stdout] 182 ~ && item.successors.contains(only) { [INFO] [stdout] 183 | self.recursive.insert(only.clone()); [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:133:21 [INFO] [stdout] | [INFO] [stdout] 133 | / current_copies = current_copies.into_iter().filter(|copy| { [INFO] [stdout] 134 | | !( [INFO] [stdout] 135 | | copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 136 | | copy.dst == *dst [INFO] [stdout] 137 | | ) [INFO] [stdout] 138 | | }).collect(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 133 ~ current_copies.retain(|copy| { [INFO] [stdout] 134 + !( [INFO] [stdout] 135 + copy.src == mir_def::Val::Var(dst.clone()) || [INFO] [stdout] 136 + copy.dst == *dst [INFO] [stdout] 137 + ) [INFO] [stdout] 138 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:163:38 [INFO] [stdout] | [INFO] [stdout] 163 | fn intersection(a: Vec, b: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 163 - fn intersection(a: Vec, b: &Vec) -> Vec { [INFO] [stdout] 163 + fn intersection(a: Vec, b: &[Copy]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:229:56 [INFO] [stdout] | [INFO] [stdout] 229 | let call = func.func.basic_blocks.as_ref().map(|b|self.get_first_call(&b)).flatten(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b|self.get_first_call(&b))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/optimizations/inlining.rs:229:83 [INFO] [stdout] | [INFO] [stdout] 229 | let call = func.func.basic_blocks.as_ref().map(|b|self.get_first_call(&b)).flatten(); [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:232:32 [INFO] [stdout] | [INFO] [stdout] 232 | let block_id = block_id.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*block_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:245:36 [INFO] [stdout] | [INFO] [stdout] 245 | let instructions = std::mem::replace(&mut block.instructions, Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut block.instructions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] = note: `#[warn(clippy::mem_replace_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/mir/optimizations/copy_propagation.rs:259:36 [INFO] [stdout] | [INFO] [stdout] 259 | if let Some(copy) = copies.into_iter().find(|c|c.dst==*v) { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/inlining.rs:323:13 [INFO] [stdout] | [INFO] [stdout] 323 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 323 - return None [INFO] [stdout] 323 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mir/optimizations/inlining.rs:316:17 [INFO] [stdout] | [INFO] [stdout] 316 | / if let mir_def::Instruction::FunctionCall { ref name, .. } = instr.instr { [INFO] [stdout] 317 | | if self.can_inline(name) { [INFO] [stdout] 318 | | return Some((id, instr.id)); [INFO] [stdout] 319 | | } [INFO] [stdout] 320 | | } [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] 316 ~ if let mir_def::Instruction::FunctionCall { ref name, .. } = instr.instr [INFO] [stdout] 317 ~ && self.can_inline(name) { [INFO] [stdout] 318 | return Some((id, instr.id)); [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:338:70 [INFO] [stdout] | [INFO] [stdout] 338 | let label_map = cfg.as_ref().unwrap().blocks.keys().map(|id|(id.clone(), { [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | id.clone() [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:357:57 [INFO] [stdout] | [INFO] [stdout] 357 | mir_def::BlockID::Generic(g) => g.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*g` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:365:65 [INFO] [stdout] | [INFO] [stdout] 365 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:373:65 [INFO] [stdout] | [INFO] [stdout] 373 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:379:65 [INFO] [stdout] | [INFO] [stdout] 379 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:389:32 [INFO] [stdout] | [INFO] [stdout] 389 | let sucs = std::mem::replace(successors, HashSet::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(successors)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:391:59 [INFO] [stdout] | [INFO] [stdout] 391 | *successors = sucs.into_iter().map(|s|label_map.get(&s).unwrap().clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*label_map.get(&s).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:396:14 [INFO] [stdout] | [INFO] [stdout] 396 | (new_id.clone(), block) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*new_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:435:26 [INFO] [stdout] | [INFO] [stdout] 435 | let tmp_instrs = std::mem::replace(&mut start_b.instructions, Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut start_b.instructions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:437:31 [INFO] [stdout] | [INFO] [stdout] 437 | let iter = iter.chain(tmp_instrs.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 437 - let iter = iter.chain(tmp_instrs.into_iter()); [INFO] [stdout] 437 + let iter = iter.chain(tmp_instrs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/inlining.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | return instr_count <= BASE_INSTRUCTION_LIMIT; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 496 - return instr_count <= BASE_INSTRUCTION_LIMIT; [INFO] [stdout] 496 + instr_count <= BASE_INSTRUCTION_LIMIT [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/optimizations/dead_store.rs:217:54 [INFO] [stdout] | [INFO] [stdout] 217 | let predecessor = cfg.blocks.get(&predecessor).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `predecessor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/dead_store.rs:247:9 [INFO] [stdout] | [INFO] [stdout] 247 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return false; [INFO] [stdout] 247 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/mir/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 17 | let optimized_mir = optimizations::optimize(mir, symbol_table, &mut instrs, &mut tmps); [INFO] [stdout] | --------------------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 18 | [INFO] [stdout] 19 | optimized_mir [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 17 ~ [INFO] [stdout] 18 | [INFO] [stdout] 19 ~ optimizations::optimize(mir, symbol_table, &mut instrs, &mut tmps) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mir/optimizations/inlining.rs:181:17 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Some(item) = self.fns.get(only) { [INFO] [stdout] 182 | | if item.successors.contains(only) { [INFO] [stdout] 183 | | self.recursive.insert(only.clone()); [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [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] 181 ~ if let Some(item) = self.fns.get(only) [INFO] [stdout] 182 ~ && item.successors.contains(only) { [INFO] [stdout] 183 | self.recursive.insert(only.clone()); [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:229:56 [INFO] [stdout] | [INFO] [stdout] 229 | let call = func.func.basic_blocks.as_ref().map(|b|self.get_first_call(&b)).flatten(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b|self.get_first_call(&b))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mir/optimizations/inlining.rs:229:83 [INFO] [stdout] | [INFO] [stdout] 229 | let call = func.func.basic_blocks.as_ref().map(|b|self.get_first_call(&b)).flatten(); [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:232:32 [INFO] [stdout] | [INFO] [stdout] 232 | let block_id = block_id.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*block_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:245:36 [INFO] [stdout] | [INFO] [stdout] 245 | let instructions = std::mem::replace(&mut block.instructions, Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut block.instructions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] = note: `#[warn(clippy::mem_replace_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/inlining.rs:323:13 [INFO] [stdout] | [INFO] [stdout] 323 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 323 - return None [INFO] [stdout] 323 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mir/optimizations/inlining.rs:316:17 [INFO] [stdout] | [INFO] [stdout] 316 | / if let mir_def::Instruction::FunctionCall { ref name, .. } = instr.instr { [INFO] [stdout] 317 | | if self.can_inline(name) { [INFO] [stdout] 318 | | return Some((id, instr.id)); [INFO] [stdout] 319 | | } [INFO] [stdout] 320 | | } [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] 316 ~ if let mir_def::Instruction::FunctionCall { ref name, .. } = instr.instr [INFO] [stdout] 317 ~ && self.can_inline(name) { [INFO] [stdout] 318 | return Some((id, instr.id)); [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:338:70 [INFO] [stdout] | [INFO] [stdout] 338 | let label_map = cfg.as_ref().unwrap().blocks.keys().map(|id|(id.clone(), { [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | id.clone() [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:357:57 [INFO] [stdout] | [INFO] [stdout] 357 | mir_def::BlockID::Generic(g) => g.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*g` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:365:65 [INFO] [stdout] | [INFO] [stdout] 365 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:373:65 [INFO] [stdout] | [INFO] [stdout] 373 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/urcl_gen/asm.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | pub fn to_string_branch(&self) -> String { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/urcl_gen/asm.rs:199:26 [INFO] [stdout] | [INFO] [stdout] 199 | pub fn to_string_set(&self) -> String { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GenericBlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:379:65 [INFO] [stdout] | [INFO] [stdout] 379 | ... mir_def::BlockID::Generic(t) => t.clone(), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:389:32 [INFO] [stdout] | [INFO] [stdout] 389 | let sucs = std::mem::replace(successors, HashSet::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(successors)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:391:59 [INFO] [stdout] | [INFO] [stdout] 391 | *successors = sucs.into_iter().map(|s|label_map.get(&s).unwrap().clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*label_map.get(&s).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BlockID` which implements the `Copy` trait [INFO] [stdout] --> src/mir/optimizations/inlining.rs:396:14 [INFO] [stdout] | [INFO] [stdout] 396 | (new_id.clone(), block) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*new_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:435:26 [INFO] [stdout] | [INFO] [stdout] 435 | let tmp_instrs = std::mem::replace(&mut start_b.instructions, Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut start_b.instructions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/mir/optimizations/inlining.rs:437:31 [INFO] [stdout] | [INFO] [stdout] 437 | let iter = iter.chain(tmp_instrs.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 437 - let iter = iter.chain(tmp_instrs.into_iter()); [INFO] [stdout] 437 + let iter = iter.chain(tmp_instrs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mir/optimizations/inlining.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | return instr_count <= BASE_INSTRUCTION_LIMIT; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 496 - return instr_count <= BASE_INSTRUCTION_LIMIT; [INFO] [stdout] 496 + instr_count <= BASE_INSTRUCTION_LIMIT [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/mir/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 17 | let optimized_mir = optimizations::optimize(mir, symbol_table, &mut instrs, &mut tmps); [INFO] [stdout] | --------------------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 18 | [INFO] [stdout] 19 | optimized_mir [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 17 ~ [INFO] [stdout] 18 | [INFO] [stdout] 19 ~ optimizations::optimize(mir, symbol_table, &mut instrs, &mut tmps) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/urcl_gen/asm.rs:297:17 [INFO] [stdout] | [INFO] [stdout] 297 | format!("RET") [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"RET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/asm.rs:345:21 [INFO] [stdout] | [INFO] [stdout] 345 | f.write_str(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/asm.rs:407:21 [INFO] [stdout] | [INFO] [stdout] 407 | f.write_str(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/urcl_gen/asm.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | pub fn to_string_branch(&self) -> String { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/urcl_gen/asm.rs:199:26 [INFO] [stdout] | [INFO] [stdout] 199 | pub fn to_string_set(&self) -> String { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/urcl_gen/asm.rs:297:17 [INFO] [stdout] | [INFO] [stdout] 297 | format!("RET") [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"RET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/urcl_gen/convert.rs:164:37 [INFO] [stdout] | [INFO] [stdout] 164 | let block = if let Some(b) = func.basic_blocks { b } else { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 165 | | return None; [INFO] [stdout] 166 | | }; [INFO] [stdout] | |_________________________^ help: replace it with: `func.basic_blocks?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/asm.rs:345:21 [INFO] [stdout] | [INFO] [stdout] 345 | f.write_str(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:273:31 [INFO] [stdout] | [INFO] [stdout] 273 | let ty = val.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/asm.rs:407:21 [INFO] [stdout] | [INFO] [stdout] 407 | f.write_str(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:304:40 [INFO] [stdout] | [INFO] [stdout] 304 | let ty = src1.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:329:96 [INFO] [stdout] | [INFO] [stdout] 329 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:380:82 [INFO] [stdout] | [INFO] [stdout] 380 | let dst_size = if let Some(ref dst) = dst { self.get_ty_from_var(&dst).size(self.type_table) } else { 0 }; [INFO] [stdout] | ^^^^ help: change this to: `dst` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/urcl_gen/convert.rs:394:17 [INFO] [stdout] | [INFO] [stdout] 394 | while let Some(arg) = args.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for arg in args.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:400:43 [INFO] [stdout] | [INFO] [stdout] 400 | let ty = arg.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/urcl_gen/convert.rs:164:37 [INFO] [stdout] | [INFO] [stdout] 164 | let block = if let Some(b) = func.basic_blocks { b } else { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 165 | | return None; [INFO] [stdout] 166 | | }; [INFO] [stdout] | |_________________________^ help: replace it with: `func.basic_blocks?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/urcl_gen/convert.rs:452:21 [INFO] [stdout] | [INFO] [stdout] 452 | ... dst.map(|dst|instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) })); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 452 - dst.map(|dst|instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) })); [INFO] [stdout] 452 + if let Some(dst) = dst { instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:273:31 [INFO] [stdout] | [INFO] [stdout] 273 | let ty = val.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:485:96 [INFO] [stdout] | [INFO] [stdout] 485 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:304:40 [INFO] [stdout] | [INFO] [stdout] 304 | let ty = src1.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:536:96 [INFO] [stdout] | [INFO] [stdout] 536 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:329:96 [INFO] [stdout] | [INFO] [stdout] 329 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:380:82 [INFO] [stdout] | [INFO] [stdout] 380 | let dst_size = if let Some(ref dst) = dst { self.get_ty_from_var(&dst).size(self.type_table) } else { 0 }; [INFO] [stdout] | ^^^^ help: change this to: `dst` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/urcl_gen/convert.rs:394:17 [INFO] [stdout] | [INFO] [stdout] 394 | while let Some(arg) = args.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for arg in args.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:400:43 [INFO] [stdout] | [INFO] [stdout] 400 | let ty = arg.get_type(&self.symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/urcl_gen/convert.rs:452:21 [INFO] [stdout] | [INFO] [stdout] 452 | ... dst.map(|dst|instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) })); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 452 - dst.map(|dst|instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) })); [INFO] [stdout] 452 + if let Some(dst) = dst { instructions.push(asm::Instr::Mov { src: asm::PVal::Reg(self.cpu.get_ret_reg()), dst: asm::PVal::Var(dst) }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/urcl_gen/convert.rs:626:17 [INFO] [stdout] | [INFO] [stdout] 626 | / val.map(|val| { [INFO] [stdout] 627 | | let val = self.val_to_asm(val, instructions); [INFO] [stdout] 628 | | [INFO] [stdout] 629 | | if let Some(ref current_return_var) = self.current_return_var { [INFO] [stdout] ... | [INFO] [stdout] 647 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 626 - val.map(|val| { [INFO] [stdout] 627 - let val = self.val_to_asm(val, instructions); [INFO] [stdout] 628 - [INFO] [stdout] 629 - if let Some(ref current_return_var) = self.current_return_var { [INFO] [stdout] 630 - // val.size must be > 1 [INFO] [stdout] 631 - let current_return_var = current_return_var.clone(); [INFO] [stdout] 632 - [INFO] [stdout] 633 - let ty = self.get_ty_from_var(¤t_return_var); [INFO] [stdout] 634 - let size = ty.size(self.type_table); [INFO] [stdout] 635 - [INFO] [stdout] 636 - let tmp_src_ptr = self.make_tmp_var(ty.clone()); [INFO] [stdout] 637 - [INFO] [stdout] 638 - instructions.push(asm::Instr::Lea { [INFO] [stdout] 639 - src: val, [INFO] [stdout] 640 - dst: asm::PVal::Var(tmp_src_ptr.clone()) [INFO] [stdout] 641 - }); [INFO] [stdout] 642 - [INFO] [stdout] 643 - self.copy_bytes(tmp_src_ptr, current_return_var, size, instructions); [INFO] [stdout] 644 - } else { [INFO] [stdout] 645 - instructions.push(asm::Instr::Mov { src: val, dst: asm::PVal::Reg(self.cpu.get_ret_reg()) }); [INFO] [stdout] 646 - } [INFO] [stdout] 647 - }); [INFO] [stdout] 626 + if let Some(val) = val { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:485:96 [INFO] [stdout] | [INFO] [stdout] 485 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/convert.rs:536:96 [INFO] [stdout] | [INFO] [stdout] 536 | if let mir_def::Type::Struct(name) | mir_def::Type::Union(name) = src.get_type(&self.symbol_table) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `self.symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/urcl_gen/convert.rs:759:13 [INFO] [stdout] | [INFO] [stdout] 759 | / match block { [INFO] [stdout] 760 | | mir_def::BasicBlock::Generic(block) => { [INFO] [stdout] 761 | | self.get_term_labels(&block.terminator.term); [INFO] [stdout] 762 | | }, [INFO] [stdout] 763 | | [INFO] [stdout] 764 | | _ => () [INFO] [stdout] 765 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 759 ~ if let mir_def::BasicBlock::Generic(block) = block { [INFO] [stdout] 760 + self.get_term_labels(&block.terminator.term); [INFO] [stdout] 761 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/urcl_gen/convert.rs:626:17 [INFO] [stdout] | [INFO] [stdout] 626 | / val.map(|val| { [INFO] [stdout] 627 | | let val = self.val_to_asm(val, instructions); [INFO] [stdout] 628 | | [INFO] [stdout] 629 | | if let Some(ref current_return_var) = self.current_return_var { [INFO] [stdout] ... | [INFO] [stdout] 647 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 626 - val.map(|val| { [INFO] [stdout] 627 - let val = self.val_to_asm(val, instructions); [INFO] [stdout] 628 - [INFO] [stdout] 629 - if let Some(ref current_return_var) = self.current_return_var { [INFO] [stdout] 630 - // val.size must be > 1 [INFO] [stdout] 631 - let current_return_var = current_return_var.clone(); [INFO] [stdout] 632 - [INFO] [stdout] 633 - let ty = self.get_ty_from_var(¤t_return_var); [INFO] [stdout] 634 - let size = ty.size(self.type_table); [INFO] [stdout] 635 - [INFO] [stdout] 636 - let tmp_src_ptr = self.make_tmp_var(ty.clone()); [INFO] [stdout] 637 - [INFO] [stdout] 638 - instructions.push(asm::Instr::Lea { [INFO] [stdout] 639 - src: val, [INFO] [stdout] 640 - dst: asm::PVal::Var(tmp_src_ptr.clone()) [INFO] [stdout] 641 - }); [INFO] [stdout] 642 - [INFO] [stdout] 643 - self.copy_bytes(tmp_src_ptr, current_return_var, size, instructions); [INFO] [stdout] 644 - } else { [INFO] [stdout] 645 - instructions.push(asm::Instr::Mov { src: val, dst: asm::PVal::Reg(self.cpu.get_ret_reg()) }); [INFO] [stdout] 646 - } [INFO] [stdout] 647 - }); [INFO] [stdout] 626 + if let Some(val) = val { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/urcl_gen/convert.rs:759:13 [INFO] [stdout] | [INFO] [stdout] 759 | / match block { [INFO] [stdout] 760 | | mir_def::BasicBlock::Generic(block) => { [INFO] [stdout] 761 | | self.get_term_labels(&block.terminator.term); [INFO] [stdout] 762 | | }, [INFO] [stdout] 763 | | [INFO] [stdout] 764 | | _ => () [INFO] [stdout] 765 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 759 ~ if let mir_def::BasicBlock::Generic(block) = block { [INFO] [stdout] 760 + self.get_term_labels(&block.terminator.term); [INFO] [stdout] 761 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CFG` contains a capitalized acronym [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct CFG<'a, CPU: CPUDefinition> { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cfg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CFG` contains a capitalized acronym [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct CFG<'a, CPU: CPUDefinition> { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cfg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:51:36 [INFO] [stdout] | [INFO] [stdout] 51 | fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 51 - fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] 51 + fn partition_into_basic_blocks(instrs: &Vec>) -> Vec<&[asm::Instr]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:51:48 [INFO] [stdout] | [INFO] [stdout] 51 | fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] 51 + fn partition_into_basic_blocks<'b>(instrs: &'b [asm::Instr]) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:51:36 [INFO] [stdout] | [INFO] [stdout] 51 | fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 51 - fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] 51 + fn partition_into_basic_blocks(instrs: &Vec>) -> Vec<&[asm::Instr]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:51:48 [INFO] [stdout] | [INFO] [stdout] 51 | fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn partition_into_basic_blocks<'b>(instrs: &'b Vec>) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] 51 + fn partition_into_basic_blocks<'b>(instrs: &'b [asm::Instr]) -> Vec<&'b[asm::Instr]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:217:75 [INFO] [stdout] | [INFO] [stdout] 217 | let updated = self.cpu.get_caller_saved().into_iter().map(|r|Reg::R(r)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Reg::R` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:230:12 [INFO] [stdout] | [INFO] [stdout] 230 | ps.into_iter().filter_map(|p|Self::pval_to_r(*p)).collect() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:230:54 [INFO] [stdout] | [INFO] [stdout] 230 | ps.into_iter().filter_map(|p|Self::pval_to_r(*p)).collect() [INFO] [stdout] | ^^ help: try: `p` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:319:42 [INFO] [stdout] | [INFO] [stdout] 319 | let b = self.instructions.last().map(|instr|{ [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 320 | | match instr { [INFO] [stdout] 321 | | asm::Instr::Ret => Some(BlockID::End), [INFO] [stdout] 322 | | asm::Instr::Branch { label, .. } | [INFO] [stdout] ... | [INFO] [stdout] 326 | | }).flatten(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 319 ~ let b = self.instructions.last().and_then(|instr|{ [INFO] [stdout] 320 + match instr { [INFO] [stdout] 321 + asm::Instr::Ret => Some(BlockID::End), [INFO] [stdout] 322 + asm::Instr::Branch { label, .. } | [INFO] [stdout] 323 + asm::Instr::Jmp { label } => Some(BlockID::Generic(*label)), [INFO] [stdout] 324 + _ => None [INFO] [stdout] 325 + } [INFO] [stdout] 326 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:217:75 [INFO] [stdout] | [INFO] [stdout] 217 | let updated = self.cpu.get_caller_saved().into_iter().map(|r|Reg::R(r)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Reg::R` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:230:12 [INFO] [stdout] | [INFO] [stdout] 230 | ps.into_iter().filter_map(|p|Self::pval_to_r(*p)).collect() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:230:54 [INFO] [stdout] | [INFO] [stdout] 230 | ps.into_iter().filter_map(|p|Self::pval_to_r(*p)).collect() [INFO] [stdout] | ^^ help: try: `p` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/cfg.rs:319:42 [INFO] [stdout] | [INFO] [stdout] 319 | let b = self.instructions.last().map(|instr|{ [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 320 | | match instr { [INFO] [stdout] 321 | | asm::Instr::Ret => Some(BlockID::End), [INFO] [stdout] 322 | | asm::Instr::Branch { label, .. } | [INFO] [stdout] ... | [INFO] [stdout] 326 | | }).flatten(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 319 ~ let b = self.instructions.last().and_then(|instr|{ [INFO] [stdout] 320 + match instr { [INFO] [stdout] 321 + asm::Instr::Ret => Some(BlockID::End), [INFO] [stdout] 322 + asm::Instr::Branch { label, .. } | [INFO] [stdout] 323 + asm::Instr::Jmp { label } => Some(BlockID::Generic(*label)), [INFO] [stdout] 324 + _ => None [INFO] [stdout] 325 + } [INFO] [stdout] 326 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | / match r { [INFO] [stdout] 211 | | asm::PVal::Var(v) => add_appear_p(appearances, v), [INFO] [stdout] 212 | | _ => () [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________^ help: try: `if let asm::PVal::Var(v) = r { add_appear_p(appearances, v) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:276:11 [INFO] [stdout] | [INFO] [stdout] 276 | }).map(|n|n); [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: deref which would be done by auto-deref [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:311:9 [INFO] [stdout] | [INFO] [stdout] 311 | (*chosen_node).pruned = true; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `chosen_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:317:37 [INFO] [stdout] | [INFO] [stdout] 317 | let mut colors = (0..k).map(|i|Some(i)).collect::>(); [INFO] [stdout] | ^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Some` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:320:36 [INFO] [stdout] | [INFO] [stdout] 320 | let n = self.graph.get(&n).unwrap(); [INFO] [stdout] | ^^ help: change this to: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:359:62 [INFO] [stdout] | [INFO] [stdout] 359 | if r != u && self.graph.contains_key(&u) && self.graph.contains_key(r) { [INFO] [stdout] | ^^ help: change this to: `u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | / match r { [INFO] [stdout] 211 | | asm::PVal::Var(v) => add_appear_p(appearances, v), [INFO] [stdout] 212 | | _ => () [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________^ help: try: `if let asm::PVal::Var(v) = r { add_appear_p(appearances, v) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:276:11 [INFO] [stdout] | [INFO] [stdout] 276 | }).map(|n|n); [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: length comparison to zero [INFO] [stdout] --> src/urcl_gen/fixup.rs:58:46 [INFO] [stdout] | [INFO] [stdout] 58 | let include_sf = stack_offset > 0 || callee_saved.len() > 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!callee_saved.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:311:9 [INFO] [stdout] | [INFO] [stdout] 311 | (*chosen_node).pruned = true; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `chosen_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:317:37 [INFO] [stdout] | [INFO] [stdout] 317 | let mut colors = (0..k).map(|i|Some(i)).collect::>(); [INFO] [stdout] | ^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Some` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:320:36 [INFO] [stdout] | [INFO] [stdout] 320 | let n = self.graph.get(&n).unwrap(); [INFO] [stdout] | ^^ help: change this to: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `IRIS` contains a capitalized acronym [INFO] [stdout] --> src/urcl_gen/cpu_definitions/mod.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 66 | pub struct IRIS; [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Iris` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/optimizations/register_allocation/mod.rs:359:62 [INFO] [stdout] | [INFO] [stdout] 359 | if r != u && self.graph.contains_key(&u) && self.graph.contains_key(r) { [INFO] [stdout] | ^^ help: change this to: `u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/mod.rs:22:35 [INFO] [stdout] | [INFO] [stdout] 22 | let statics = get_all_statics(&symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/mod.rs:30:118 [INFO] [stdout] | [INFO] [stdout] 30 | ...val(initial, &stat_and_al, &conv_info, &symbol_table, type_table); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/urcl_gen/fixup.rs:58:46 [INFO] [stdout] | [INFO] [stdout] 58 | let include_sf = stack_offset > 0 || callee_saved.len() > 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!callee_saved.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `IRIS` contains a capitalized acronym [INFO] [stdout] --> src/urcl_gen/cpu_definitions/mod.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 66 | pub struct IRIS; [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Iris` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/mod.rs:22:35 [INFO] [stdout] | [INFO] [stdout] 22 | let statics = get_all_statics(&symbol_table); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/urcl_gen/mod.rs:30:118 [INFO] [stdout] | [INFO] [stdout] 30 | ...val(initial, &stat_and_al, &conv_info, &symbol_table, type_table); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `symbol_table` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/c_to_urcl-db62a7a3314ada8a/out/grammar.rs:10603:9 [INFO] [stdout] | [INFO] [stdout] 10603 | return (ty, storage_class) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 10603 - return (ty, storage_class) [INFO] [stdout] 10603 + (ty, storage_class) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> /opt/rustwide/target/debug/build/c_to_urcl-db62a7a3314ada8a/out/grammar.rs:10577:9 [INFO] [stdout] | [INFO] [stdout] 10577 | while let Some(spec) = spec_list.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for spec in spec_list` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/c_to_urcl-db62a7a3314ada8a/out/grammar.rs:10603:9 [INFO] [stdout] | [INFO] [stdout] 10603 | return (ty, storage_class) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 10603 - return (ty, storage_class) [INFO] [stdout] 10603 + (ty, storage_class) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> /opt/rustwide/target/debug/build/c_to_urcl-db62a7a3314ada8a/out/grammar.rs:10577:9 [INFO] [stdout] | [INFO] [stdout] 10577 | while let Some(spec) = spec_list.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for spec in spec_list` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 27.22s [INFO] running `Command { std: "docker" "inspect" "22c8043d36e554ad4e6365e28a77cf1c09d3bf16812563288627ad268876dae1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "22c8043d36e554ad4e6365e28a77cf1c09d3bf16812563288627ad268876dae1", kill_on_drop: false }` [INFO] [stdout] 22c8043d36e554ad4e6365e28a77cf1c09d3bf16812563288627ad268876dae1