[INFO] cloning repository https://github.com/thejohncrafter/projets-2020 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/thejohncrafter/projets-2020" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthejohncrafter%2Fprojets-2020", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthejohncrafter%2Fprojets-2020'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 2c4525f5d241a67663a1f74f2326abd2890c44fa [INFO] linting thejohncrafter/projets-2020 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthejohncrafter%2Fprojets-2020" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/thejohncrafter/projets-2020 [INFO] finished tweaking git repo https://github.com/thejohncrafter/projets-2020 [INFO] tweaked toml for git repo https://github.com/thejohncrafter/projets-2020 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/thejohncrafter/projets-2020 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/thejohncrafter/projets-2020 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-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] e776145945720cf8704293c7cfa24146c96ba02b7dccd571a7e7cf249d209ec4 [INFO] running `Command { std: "docker" "start" "-a" "e776145945720cf8704293c7cfa24146c96ba02b7dccd571a7e7cf249d209ec4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e776145945720cf8704293c7cfa24146c96ba02b7dccd571a7e7cf249d209ec4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e776145945720cf8704293c7cfa24146c96ba02b7dccd571a7e7cf249d209ec4", kill_on_drop: false }` [INFO] [stdout] e776145945720cf8704293c7cfa24146c96ba02b7dccd571a7e7cf249d209ec4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] e3a0ddda45bbc32e5b26df52b30afdfbdc27dc712d5af2fcfe1bf7dbdbe32efa [INFO] running `Command { std: "docker" "start" "-a" "e3a0ddda45bbc32e5b26df52b30afdfbdc27dc712d5af2fcfe1bf7dbdbe32efa", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.24 [INFO] [stderr] Compiling syn v1.0.48 [INFO] [stderr] Compiling libc v0.2.80 [INFO] [stderr] Compiling unicode-xid v0.2.1 [INFO] [stderr] Compiling bitflags v1.2.1 [INFO] [stderr] Compiling automata v0.1.0 (/opt/rustwide/workdir/automata) [INFO] [stdout] warning: unused import: `macros::*` [INFO] [stdout] --> automata/src/lexer/mod.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | pub use macros::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `macros::*` [INFO] [stdout] --> automata/src/lexer/mod.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | pub use macros::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `macros::*` [INFO] [stdout] --> automata/src/lexer/mod.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | pub use macros::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `macros::*` [INFO] [stdout] --> automata/src/lexer/mod.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | pub use macros::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print_extra_info` is never used [INFO] [stdout] --> automata/src/parser/items.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait LRItem: Ord + Copy { [INFO] [stdout] | ------ method in this trait [INFO] [stdout] ... [INFO] [stdout] 77 | fn print_extra_info(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> automata/src/parser/pda.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | Token(Symbol, Option), [INFO] [stdout] | ----- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `StackItem` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 8 - Token(Symbol, Option), [INFO] [stdout] 8 + Token((), Option), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | if last(l).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | if last(e).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [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] --> automata/src/lexer/building.rs:31:41 [INFO] [stdout] | [INFO] [stdout] 31 | IChar::Char(c1, _) => is_in(&c, c1), [INFO] [stdout] | ^^ help: change this to: `c` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> automata/src/lexer/building.rs:61:53 [INFO] [stdout] | [INFO] [stdout] 61 | IChar::Hash(i) => CharOrEof::Eof(i.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> automata/src/lexer/building.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | / match accept { [INFO] [stdout] 72 | | None => accept = Some(i), [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ help: try: `if accept == None { accept = Some(i) }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/lexer/building.rs:144:8 [INFO] [stdout] | [INFO] [stdout] 144 | if exps.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exps.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/building.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | prods: &'a [&dyn Fn(S::Span, &str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/builder.rs:118:16 [INFO] [stdout] | [INFO] [stdout] 118 | if state.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!state.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: the loop variable `i` is used to index `actions` [INFO] [stdout] --> automata/src/parser/builder.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | for i in 0..self.term_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 169 - for i in 0..self.term_count { [INFO] [stdout] 169 + for (i, ) in actions.iter_mut().enumerate().take(self.term_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/builder.rs:171:36 [INFO] [stdout] | [INFO] [stdout] 171 | ... if let None = actions[i] { [INFO] [stdout] | -------^^^^------------- help: try: `if actions[i].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/items.rs:22:55 [INFO] [stdout] | [INFO] [stdout] 22 | .filter(|r| r.symbol == *k && r.expand.len() != 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.expand.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/parser/items.rs:23:50 [INFO] [stdout] | [INFO] [stdout] 23 | .for_each(|r| self.visit(&r.expand.first().unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `r.expand.first().unwrap()` [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] --> automata/src/parser/api.rs:35:52 [INFO] [stdout] | [INFO] [stdout] 35 | expand: vec!(Symbol::N(nterm_index(&start)), Symbol::T(0)), [INFO] [stdout] | ^^^^^^ help: change this to: `start` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> automata/src/parser/api.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | }).chain(prods.into_iter().map(|(s, t)| { [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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> automata/src/parser/api.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | let expand = t.into_iter().map(|name| { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/parser/pda.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | builders: &[&dyn Fn(S, Vec>) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/pda.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if let None = token.2 { [INFO] [stdout] | -------^^^^---------- help: try: `if token.2.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> automata/src/parser/pda.rs:76:58 [INFO] [stdout] | [INFO] [stdout] 76 | let builder = builders.get(*rule_id).expect(&format!("Missing builder {}.", rule_id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Missing builder {}.", rule_id))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `(S, std::string::String)` [INFO] [stdout] --> automata/src/parser/pda.rs:83:57 [INFO] [stdout] | [INFO] [stdout] 83 | let built = built.map_err(|msg| (span, msg).into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(span, msg)` [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: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> automata/src/parser/builder.rs:22:10 [INFO] [stdout] | [INFO] [stdout] 20 | rules: &'a [Production], [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 21 | term_count: usize, nterm_count: usize, [INFO] [stdout] 22 | ) -> Builder { [INFO] [stdout] | ^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 22 | ) -> Builder<'a, I> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> automata/src/parser/api.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: remove the `format!(..)` macro call [INFO] [stdout] | [INFO] [stdout] 26 - panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] 26 + panic!("Can't find the non-terminal \"{}\"", name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print_extra_info` is never used [INFO] [stdout] --> automata/src/parser/items.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait LRItem: Ord + Copy { [INFO] [stdout] | ------ method in this trait [INFO] [stdout] ... [INFO] [stdout] 77 | fn print_extra_info(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> automata/src/parser/pda.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | Token(Symbol, Option), [INFO] [stdout] | ----- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `StackItem` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 8 - Token(Symbol, Option), [INFO] [stdout] 8 + Token((), Option), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | if last(l).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | if last(e).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [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] --> automata/src/lexer/building.rs:31:41 [INFO] [stdout] | [INFO] [stdout] 31 | IChar::Char(c1, _) => is_in(&c, c1), [INFO] [stdout] | ^^ help: change this to: `c` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> automata/src/lexer/building.rs:61:53 [INFO] [stdout] | [INFO] [stdout] 61 | IChar::Hash(i) => CharOrEof::Eof(i.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> automata/src/lexer/building.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | / match accept { [INFO] [stdout] 72 | | None => accept = Some(i), [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ help: try: `if accept == None { accept = Some(i) }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/lexer/building.rs:144:8 [INFO] [stdout] | [INFO] [stdout] 144 | if exps.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exps.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/building.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | prods: &'a [&dyn Fn(S::Span, &str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/builder.rs:118:16 [INFO] [stdout] | [INFO] [stdout] 118 | if state.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!state.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: the loop variable `i` is used to index `actions` [INFO] [stdout] --> automata/src/parser/builder.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | for i in 0..self.term_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 169 - for i in 0..self.term_count { [INFO] [stdout] 169 + for (i, ) in actions.iter_mut().enumerate().take(self.term_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/builder.rs:171:36 [INFO] [stdout] | [INFO] [stdout] 171 | ... if let None = actions[i] { [INFO] [stdout] | -------^^^^------------- help: try: `if actions[i].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/items.rs:22:55 [INFO] [stdout] | [INFO] [stdout] 22 | .filter(|r| r.symbol == *k && r.expand.len() != 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.expand.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/parser/items.rs:23:50 [INFO] [stdout] | [INFO] [stdout] 23 | .for_each(|r| self.visit(&r.expand.first().unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `r.expand.first().unwrap()` [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] --> automata/src/parser/api.rs:35:52 [INFO] [stdout] | [INFO] [stdout] 35 | expand: vec!(Symbol::N(nterm_index(&start)), Symbol::T(0)), [INFO] [stdout] | ^^^^^^ help: change this to: `start` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> automata/src/parser/api.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | }).chain(prods.into_iter().map(|(s, t)| { [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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> automata/src/parser/api.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | let expand = t.into_iter().map(|name| { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/parser/pda.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | builders: &[&dyn Fn(S, Vec>) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/pda.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if let None = token.2 { [INFO] [stdout] | -------^^^^---------- help: try: `if token.2.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> automata/src/parser/pda.rs:76:58 [INFO] [stdout] | [INFO] [stdout] 76 | let builder = builders.get(*rule_id).expect(&format!("Missing builder {}.", rule_id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Missing builder {}.", rule_id))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `(S, std::string::String)` [INFO] [stdout] --> automata/src/parser/pda.rs:83:57 [INFO] [stdout] | [INFO] [stdout] 83 | let built = built.map_err(|msg| (span, msg).into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(span, msg)` [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: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> automata/src/parser/builder.rs:22:10 [INFO] [stdout] | [INFO] [stdout] 20 | rules: &'a [Production], [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 21 | term_count: usize, nterm_count: usize, [INFO] [stdout] 22 | ) -> Builder { [INFO] [stdout] | ^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 22 | ) -> Builder<'a, I> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> automata/src/parser/api.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: remove the `format!(..)` macro call [INFO] [stdout] | [INFO] [stdout] 26 - panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] 26 + panic!("Can't find the non-terminal \"{}\"", name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print_extra_info` is never used [INFO] [stdout] --> automata/src/parser/items.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait LRItem: Ord + Copy { [INFO] [stdout] | ------ method in this trait [INFO] [stdout] ... [INFO] [stdout] 77 | fn print_extra_info(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> automata/src/parser/pda.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | Token(Symbol, Option), [INFO] [stdout] | ----- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `StackItem` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 8 - Token(Symbol, Option), [INFO] [stdout] 8 + Token((), Option), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | if last(l).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | if last(e).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [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] --> automata/src/lexer/building.rs:31:41 [INFO] [stdout] | [INFO] [stdout] 31 | IChar::Char(c1, _) => is_in(&c, c1), [INFO] [stdout] | ^^ help: change this to: `c` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> automata/src/lexer/building.rs:61:53 [INFO] [stdout] | [INFO] [stdout] 61 | IChar::Hash(i) => CharOrEof::Eof(i.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> automata/src/lexer/building.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | / match accept { [INFO] [stdout] 72 | | None => accept = Some(i), [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ help: try: `if accept == None { accept = Some(i) }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/lexer/building.rs:144:8 [INFO] [stdout] | [INFO] [stdout] 144 | if exps.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exps.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/building.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | prods: &'a [&dyn Fn(S::Span, &str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/builder.rs:118:16 [INFO] [stdout] | [INFO] [stdout] 118 | if state.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!state.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: the loop variable `i` is used to index `actions` [INFO] [stdout] --> automata/src/parser/builder.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | for i in 0..self.term_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 169 - for i in 0..self.term_count { [INFO] [stdout] 169 + for (i, ) in actions.iter_mut().enumerate().take(self.term_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/builder.rs:171:36 [INFO] [stdout] | [INFO] [stdout] 171 | ... if let None = actions[i] { [INFO] [stdout] | -------^^^^------------- help: try: `if actions[i].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/items.rs:22:55 [INFO] [stdout] | [INFO] [stdout] 22 | .filter(|r| r.symbol == *k && r.expand.len() != 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.expand.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/parser/items.rs:23:50 [INFO] [stdout] | [INFO] [stdout] 23 | .for_each(|r| self.visit(&r.expand.first().unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `r.expand.first().unwrap()` [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] --> automata/src/parser/api.rs:35:52 [INFO] [stdout] | [INFO] [stdout] 35 | expand: vec!(Symbol::N(nterm_index(&start)), Symbol::T(0)), [INFO] [stdout] | ^^^^^^ help: change this to: `start` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> automata/src/parser/api.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | }).chain(prods.into_iter().map(|(s, t)| { [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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> automata/src/parser/api.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | let expand = t.into_iter().map(|name| { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/parser/pda.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | builders: &[&dyn Fn(S, Vec>) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/pda.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if let None = token.2 { [INFO] [stdout] | -------^^^^---------- help: try: `if token.2.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> automata/src/parser/pda.rs:76:58 [INFO] [stdout] | [INFO] [stdout] 76 | let builder = builders.get(*rule_id).expect(&format!("Missing builder {}.", rule_id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Missing builder {}.", rule_id))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `(S, std::string::String)` [INFO] [stdout] --> automata/src/parser/pda.rs:83:57 [INFO] [stdout] | [INFO] [stdout] 83 | let built = built.map_err(|msg| (span, msg).into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(span, msg)` [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: method `print_extra_info` is never used [INFO] [stdout] --> automata/src/parser/items.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait LRItem: Ord + Copy { [INFO] [stdout] | ------ method in this trait [INFO] [stdout] ... [INFO] [stdout] 77 | fn print_extra_info(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> automata/src/parser/pda.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | Token(Symbol, Option), [INFO] [stdout] | ----- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `StackItem` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 8 - Token(Symbol, Option), [INFO] [stdout] 8 + Token((), Option), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | if last(l).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/lexer/sets.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | if last(e).contains(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [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] --> automata/src/lexer/building.rs:31:41 [INFO] [stdout] | [INFO] [stdout] 31 | IChar::Char(c1, _) => is_in(&c, c1), [INFO] [stdout] | ^^ help: change this to: `c` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> automata/src/lexer/building.rs:61:53 [INFO] [stdout] | [INFO] [stdout] 61 | IChar::Hash(i) => CharOrEof::Eof(i.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> automata/src/lexer/building.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | / match accept { [INFO] [stdout] 72 | | None => accept = Some(i), [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ help: try: `if accept == None { accept = Some(i) }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> automata/src/parser/builder.rs:22:10 [INFO] [stdout] | [INFO] [stdout] 20 | rules: &'a [Production], [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 21 | term_count: usize, nterm_count: usize, [INFO] [stdout] 22 | ) -> Builder { [INFO] [stdout] | ^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 22 | ) -> Builder<'a, I> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/lexer/building.rs:144:8 [INFO] [stdout] | [INFO] [stdout] 144 | if exps.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exps.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/building.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | prods: &'a [&dyn Fn(S::Span, &str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/lexer/dfa.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | producers: &'a [&'a dyn Fn(S::Span, &'a str) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/builder.rs:118:16 [INFO] [stdout] | [INFO] [stdout] 118 | if state.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!state.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: the loop variable `i` is used to index `actions` [INFO] [stdout] --> automata/src/parser/builder.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | for i in 0..self.term_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 169 - for i in 0..self.term_count { [INFO] [stdout] 169 + for (i, ) in actions.iter_mut().enumerate().take(self.term_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/builder.rs:171:36 [INFO] [stdout] | [INFO] [stdout] 171 | ... if let None = actions[i] { [INFO] [stdout] | -------^^^^------------- help: try: `if actions[i].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> automata/src/parser/api.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: remove the `format!(..)` macro call [INFO] [stdout] | [INFO] [stdout] 26 - panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] 26 + panic!("Can't find the non-terminal \"{}\"", name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> automata/src/parser/items.rs:22:55 [INFO] [stdout] | [INFO] [stdout] 22 | .filter(|r| r.symbol == *k && r.expand.len() != 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.expand.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> automata/src/parser/items.rs:23:50 [INFO] [stdout] | [INFO] [stdout] 23 | .for_each(|r| self.visit(&r.expand.first().unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `r.expand.first().unwrap()` [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] --> automata/src/parser/api.rs:35:52 [INFO] [stdout] | [INFO] [stdout] 35 | expand: vec!(Symbol::N(nterm_index(&start)), Symbol::T(0)), [INFO] [stdout] | ^^^^^^ help: change this to: `start` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> automata/src/parser/api.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | }).chain(prods.into_iter().map(|(s, t)| { [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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> automata/src/parser/api.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | let expand = t.into_iter().map(|name| { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> automata/src/parser/pda.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | builders: &[&dyn Fn(S, Vec>) -> Result], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> automata/src/parser/pda.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if let None = token.2 { [INFO] [stdout] | -------^^^^---------- help: try: `if token.2.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> automata/src/parser/pda.rs:76:58 [INFO] [stdout] | [INFO] [stdout] 76 | let builder = builders.get(*rule_id).expect(&format!("Missing builder {}.", rule_id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Missing builder {}.", rule_id))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `(S, std::string::String)` [INFO] [stdout] --> automata/src/parser/pda.rs:83:57 [INFO] [stdout] | [INFO] [stdout] 83 | let built = built.map_err(|msg| (span, msg).into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(span, msg)` [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: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> automata/src/parser/builder.rs:22:10 [INFO] [stdout] | [INFO] [stdout] 20 | rules: &'a [Production], [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 21 | term_count: usize, nterm_count: usize, [INFO] [stdout] 22 | ) -> Builder { [INFO] [stdout] | ^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 22 | ) -> Builder<'a, I> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> automata/src/parser/api.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: remove the `format!(..)` macro call [INFO] [stdout] | [INFO] [stdout] 26 - panic!(format!("Can't find the non-terminal \"{}\"", name)) [INFO] [stdout] 26 + panic!("Can't find the non-terminal \"{}\"", name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling quote v1.0.7 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking clap v2.33.3 [INFO] [stderr] Checking parsergen v0.1.0 (/opt/rustwide/workdir/parsergen) [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> parsergen/src/lexer/regexp.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | }; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> parsergen/src/lexer/regexp.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | }; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> parsergen/src/parser/input.rs:93:42 [INFO] [stdout] | [INFO] [stdout] 93 | fn parse_rule_lhs(input: ParseStream) -> Result<(Ident, Vec<(Option, Ident)>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parsergen/src/parser/input.rs:149:5 [INFO] [stdout] | [INFO] [stdout] 149 | Ok(body.parse()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 149 - Ok(body.parse()?) [INFO] [stdout] 149 + body.parse() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Some(ident) = x { [INFO] [stdout] 36 | | Some(ident.to_string()) [INFO] [stdout] 37 | | } else { [INFO] [stdout] 38 | | None [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________________^ help: try: `x.as_ref().map(|ident| ident.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:75:31 [INFO] [stdout] | [INFO] [stdout] 75 | tokens.iter().enumerate().map(|(i, typed)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 76 | | let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 | | [INFO] [stdout] 78 | | let i = i + 1; [INFO] [stdout] ... | [INFO] [stdout] 85 | | }).flatten().collect() [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] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 75 ~ tokens.iter().enumerate().flat_map(|(i, typed)| { [INFO] [stdout] 76 + let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 + [INFO] [stdout] 78 + let i = i + 1; [INFO] [stdout] 79 + let ty = &typed.1; [INFO] [stdout] 80 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 81 + [INFO] [stdout] 82 + quote! { [INFO] [stdout] 83 + fn #ident<#src_lifetime>(x: #ty) -> (usize, #holder_ident<#src_lifetime>) {(#i, #holder_ident::#ident(x))} [INFO] [stdout] 84 + } [INFO] [stdout] 85 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `proc_macro2::TokenStream` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:92:30 [INFO] [stdout] | [INFO] [stdout] 92 | let e: TokenStream = (quote! {#ident(#ty)}).into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `quote! {#ident(#ty)}` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:96:31 [INFO] [stdout] | [INFO] [stdout] 96 | let intos = tokens.iter().map(|(ident, ty)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 97 | | let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 | | quote! { [INFO] [stdout] 99 | | fn #into_name(self) -> #ty { [INFO] [stdout] ... | [INFO] [stdout] 106 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 96 ~ let intos = tokens.iter().flat_map(|(ident, ty)| { [INFO] [stdout] 97 + let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 + quote! { [INFO] [stdout] 99 + fn #into_name(self) -> #ty { [INFO] [stdout] 100 + match self { [INFO] [stdout] 101 + #holder_ident::#ident(x) => x, [INFO] [stdout] 102 + _ => panic!() [INFO] [stdout] 103 + } [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } [INFO] [stdout] 106 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:122:30 [INFO] [stdout] | [INFO] [stdout] 122 | rules.iter().enumerate().map(|(i, rule)| { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 123 | | let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 | | let span_ty = &types_info.span_ty; [INFO] [stdout] 125 | | let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] ... | [INFO] [stdout] 168 | | }).flatten().collect() [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 122 ~ rules.iter().enumerate().flat_map(|(i, rule)| { [INFO] [stdout] 123 + let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 + let span_ty = &types_info.span_ty; [INFO] [stdout] 125 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 126 + let fn_ident = Ident::new(&format!("rule_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 127 + let fn_return_type = token_types.get(&rule.token.to_string()).unwrap(); [INFO] [stdout] 128 + let fn_return_variant = Ident::new(&format!("{}", rule.token), Span::mixed_site()); [INFO] [stdout] 129 + let closure_ident = Ident::new(&format!("prod_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 130 + let body = &rule.block.contents; [INFO] [stdout] 131 + [INFO] [stdout] 132 + let span_ident = Ident::new("span", Span::mixed_site()); [INFO] [stdout] 133 + [INFO] [stdout] 134 + let args_decl = rule.expand.iter().filter_map(|(x, ident)| { [INFO] [stdout] 135 + if let Some(arg_ident) = x { [INFO] [stdout] 136 + let token = ident.to_string(); [INFO] [stdout] 137 + let ty = token_types.get(&token).unwrap(); [INFO] [stdout] 138 + let arg_name = Ident::new(&arg_ident.to_string(), Span::mixed_site()); [INFO] [stdout] 139 + let exp: TokenStream = quote! { [INFO] [stdout] 140 + #arg_name: #ty [INFO] [stdout] 141 + }; [INFO] [stdout] 142 + Some(exp) [INFO] [stdout] 143 + } else { [INFO] [stdout] 144 + None [INFO] [stdout] 145 + } [INFO] [stdout] 146 + }); [INFO] [stdout] 147 + [INFO] [stdout] 148 + let args_getters = rule.expand.iter().enumerate().filter_map(|(i, (x, ident))| { [INFO] [stdout] 149 + if x.is_some() { [INFO] [stdout] 150 + let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] 151 + let exp: TokenStream = quote! { [INFO] [stdout] 152 + a[#i].take().unwrap().#into_name() [INFO] [stdout] 153 + }; [INFO] [stdout] 154 + Some(exp) [INFO] [stdout] 155 + } else { [INFO] [stdout] 156 + None [INFO] [stdout] 157 + } [INFO] [stdout] 158 + }); [INFO] [stdout] 159 + [INFO] [stdout] 160 + quote! { [INFO] [stdout] 161 + fn #fn_ident<#src_lifetime>(#span_ident: #span_ty, #(#args_decl),*) -> Result<#fn_return_type, String> { [INFO] [stdout] 162 + #body [INFO] [stdout] 163 + } [INFO] [stdout] 164 + [INFO] [stdout] 165 + let #closure_ident = |span: #span_ty, mut a: Vec>>| [INFO] [stdout] 166 + #fn_ident(span, #(#args_getters),*).map(|x| #holder_ident::#fn_return_variant(x)); [INFO] [stdout] 167 + } [INFO] [stdout] 168 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:150:69 [INFO] [stdout] | [INFO] [stdout] 150 | let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:207:32 [INFO] [stdout] | [INFO] [stdout] 207 | let s_rules = rules.iter().map(|prod| { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 208 | | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] ... | [INFO] [stdout] 222 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 207 ~ let s_rules = rules.iter().flat_map(|prod| { [INFO] [stdout] 208 + let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 + }).flatten().collect::(); [INFO] [stdout] 214 + [INFO] [stdout] 215 + let symbol = prod.symbol; [INFO] [stdout] 216 + quote! { [INFO] [stdout] 217 + ::automata::parser::types::Production { [INFO] [stdout] 218 + symbol: #symbol, [INFO] [stdout] 219 + expand: vec!(#s_expand), [INFO] [stdout] 220 + }, [INFO] [stdout] 221 + } [INFO] [stdout] 222 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:208:43 [INFO] [stdout] | [INFO] [stdout] 208 | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 | | types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 | | } [INFO] [stdout] 213 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 208 ~ let s_expand = prod.expand.iter().flat_map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:224:34 [INFO] [stdout] | [INFO] [stdout] 224 | let s_states = states.iter().map(|(actions, gotos)| { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 225 | | let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] ... | [INFO] [stdout] 249 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 224 ~ let s_states = states.iter().flat_map(|(actions, gotos)| { [INFO] [stdout] 225 + let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 + }).flatten().collect::(); [INFO] [stdout] 234 + [INFO] [stdout] 235 + let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 + }).flatten().collect::(); [INFO] [stdout] 245 + [INFO] [stdout] 246 + quote! { [INFO] [stdout] 247 + v.push((vec!(#s_actions), vec!(#s_gotos))); [INFO] [stdout] 248 + } [INFO] [stdout] 249 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:225:40 [INFO] [stdout] | [INFO] [stdout] 225 | let s_actions = actions.iter().map(|action| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] 228 | | quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] ... | [INFO] [stdout] 233 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 225 ~ let s_actions = actions.iter().flat_map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:235:36 [INFO] [stdout] | [INFO] [stdout] 235 | let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 236 | | match goto { [INFO] [stdout] 237 | | types::Goto::Accept => [INFO] [stdout] 238 | | quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] ... | [INFO] [stdout] 244 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 235 ~ let s_gotos = gotos.iter().flat_map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:30:26 [INFO] [stdout] | [INFO] [stdout] 30 | input.on_empty.check(&vec!())?; [INFO] [stdout] | ^^^^^^^ help: you can use a slice directly: `&[]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> parsergen/src/parser/input.rs:93:42 [INFO] [stdout] | [INFO] [stdout] 93 | fn parse_rule_lhs(input: ParseStream) -> Result<(Ident, Vec<(Option, Ident)>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parsergen/src/parser/input.rs:149:5 [INFO] [stdout] | [INFO] [stdout] 149 | Ok(body.parse()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 149 - Ok(body.parse()?) [INFO] [stdout] 149 + body.parse() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Some(ident) = x { [INFO] [stdout] 36 | | Some(ident.to_string()) [INFO] [stdout] 37 | | } else { [INFO] [stdout] 38 | | None [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________________^ help: try: `x.as_ref().map(|ident| ident.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:75:31 [INFO] [stdout] | [INFO] [stdout] 75 | tokens.iter().enumerate().map(|(i, typed)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 76 | | let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 | | [INFO] [stdout] 78 | | let i = i + 1; [INFO] [stdout] ... | [INFO] [stdout] 85 | | }).flatten().collect() [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] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 75 ~ tokens.iter().enumerate().flat_map(|(i, typed)| { [INFO] [stdout] 76 + let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 + [INFO] [stdout] 78 + let i = i + 1; [INFO] [stdout] 79 + let ty = &typed.1; [INFO] [stdout] 80 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 81 + [INFO] [stdout] 82 + quote! { [INFO] [stdout] 83 + fn #ident<#src_lifetime>(x: #ty) -> (usize, #holder_ident<#src_lifetime>) {(#i, #holder_ident::#ident(x))} [INFO] [stdout] 84 + } [INFO] [stdout] 85 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `proc_macro2::TokenStream` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:92:30 [INFO] [stdout] | [INFO] [stdout] 92 | let e: TokenStream = (quote! {#ident(#ty)}).into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `quote! {#ident(#ty)}` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:96:31 [INFO] [stdout] | [INFO] [stdout] 96 | let intos = tokens.iter().map(|(ident, ty)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 97 | | let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 | | quote! { [INFO] [stdout] 99 | | fn #into_name(self) -> #ty { [INFO] [stdout] ... | [INFO] [stdout] 106 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 96 ~ let intos = tokens.iter().flat_map(|(ident, ty)| { [INFO] [stdout] 97 + let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 + quote! { [INFO] [stdout] 99 + fn #into_name(self) -> #ty { [INFO] [stdout] 100 + match self { [INFO] [stdout] 101 + #holder_ident::#ident(x) => x, [INFO] [stdout] 102 + _ => panic!() [INFO] [stdout] 103 + } [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } [INFO] [stdout] 106 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:122:30 [INFO] [stdout] | [INFO] [stdout] 122 | rules.iter().enumerate().map(|(i, rule)| { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 123 | | let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 | | let span_ty = &types_info.span_ty; [INFO] [stdout] 125 | | let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] ... | [INFO] [stdout] 168 | | }).flatten().collect() [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 122 ~ rules.iter().enumerate().flat_map(|(i, rule)| { [INFO] [stdout] 123 + let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 + let span_ty = &types_info.span_ty; [INFO] [stdout] 125 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 126 + let fn_ident = Ident::new(&format!("rule_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 127 + let fn_return_type = token_types.get(&rule.token.to_string()).unwrap(); [INFO] [stdout] 128 + let fn_return_variant = Ident::new(&format!("{}", rule.token), Span::mixed_site()); [INFO] [stdout] 129 + let closure_ident = Ident::new(&format!("prod_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 130 + let body = &rule.block.contents; [INFO] [stdout] 131 + [INFO] [stdout] 132 + let span_ident = Ident::new("span", Span::mixed_site()); [INFO] [stdout] 133 + [INFO] [stdout] 134 + let args_decl = rule.expand.iter().filter_map(|(x, ident)| { [INFO] [stdout] 135 + if let Some(arg_ident) = x { [INFO] [stdout] 136 + let token = ident.to_string(); [INFO] [stdout] 137 + let ty = token_types.get(&token).unwrap(); [INFO] [stdout] 138 + let arg_name = Ident::new(&arg_ident.to_string(), Span::mixed_site()); [INFO] [stdout] 139 + let exp: TokenStream = quote! { [INFO] [stdout] 140 + #arg_name: #ty [INFO] [stdout] 141 + }; [INFO] [stdout] 142 + Some(exp) [INFO] [stdout] 143 + } else { [INFO] [stdout] 144 + None [INFO] [stdout] 145 + } [INFO] [stdout] 146 + }); [INFO] [stdout] 147 + [INFO] [stdout] 148 + let args_getters = rule.expand.iter().enumerate().filter_map(|(i, (x, ident))| { [INFO] [stdout] 149 + if x.is_some() { [INFO] [stdout] 150 + let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] 151 + let exp: TokenStream = quote! { [INFO] [stdout] 152 + a[#i].take().unwrap().#into_name() [INFO] [stdout] 153 + }; [INFO] [stdout] 154 + Some(exp) [INFO] [stdout] 155 + } else { [INFO] [stdout] 156 + None [INFO] [stdout] 157 + } [INFO] [stdout] 158 + }); [INFO] [stdout] 159 + [INFO] [stdout] 160 + quote! { [INFO] [stdout] 161 + fn #fn_ident<#src_lifetime>(#span_ident: #span_ty, #(#args_decl),*) -> Result<#fn_return_type, String> { [INFO] [stdout] 162 + #body [INFO] [stdout] 163 + } [INFO] [stdout] 164 + [INFO] [stdout] 165 + let #closure_ident = |span: #span_ty, mut a: Vec>>| [INFO] [stdout] 166 + #fn_ident(span, #(#args_getters),*).map(|x| #holder_ident::#fn_return_variant(x)); [INFO] [stdout] 167 + } [INFO] [stdout] 168 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:150:69 [INFO] [stdout] | [INFO] [stdout] 150 | let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:207:32 [INFO] [stdout] | [INFO] [stdout] 207 | let s_rules = rules.iter().map(|prod| { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 208 | | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] ... | [INFO] [stdout] 222 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 207 ~ let s_rules = rules.iter().flat_map(|prod| { [INFO] [stdout] 208 + let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 + }).flatten().collect::(); [INFO] [stdout] 214 + [INFO] [stdout] 215 + let symbol = prod.symbol; [INFO] [stdout] 216 + quote! { [INFO] [stdout] 217 + ::automata::parser::types::Production { [INFO] [stdout] 218 + symbol: #symbol, [INFO] [stdout] 219 + expand: vec!(#s_expand), [INFO] [stdout] 220 + }, [INFO] [stdout] 221 + } [INFO] [stdout] 222 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:208:43 [INFO] [stdout] | [INFO] [stdout] 208 | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 | | types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 | | } [INFO] [stdout] 213 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 208 ~ let s_expand = prod.expand.iter().flat_map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:224:34 [INFO] [stdout] | [INFO] [stdout] 224 | let s_states = states.iter().map(|(actions, gotos)| { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 225 | | let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] ... | [INFO] [stdout] 249 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 224 ~ let s_states = states.iter().flat_map(|(actions, gotos)| { [INFO] [stdout] 225 + let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 + }).flatten().collect::(); [INFO] [stdout] 234 + [INFO] [stdout] 235 + let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 + }).flatten().collect::(); [INFO] [stdout] 245 + [INFO] [stdout] 246 + quote! { [INFO] [stdout] 247 + v.push((vec!(#s_actions), vec!(#s_gotos))); [INFO] [stdout] 248 + } [INFO] [stdout] 249 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:225:40 [INFO] [stdout] | [INFO] [stdout] 225 | let s_actions = actions.iter().map(|action| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] 228 | | quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] ... | [INFO] [stdout] 233 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 225 ~ let s_actions = actions.iter().flat_map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:235:36 [INFO] [stdout] | [INFO] [stdout] 235 | let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 236 | | match goto { [INFO] [stdout] 237 | | types::Goto::Accept => [INFO] [stdout] 238 | | quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] ... | [INFO] [stdout] 244 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 235 ~ let s_gotos = gotos.iter().flat_map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:30:26 [INFO] [stdout] | [INFO] [stdout] 30 | input.on_empty.check(&vec!())?; [INFO] [stdout] | ^^^^^^^ help: you can use a slice directly: `&[]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> parsergen/src/lexer/regexp.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | }; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> parsergen/src/parser/input.rs:93:42 [INFO] [stdout] | [INFO] [stdout] 93 | fn parse_rule_lhs(input: ParseStream) -> Result<(Ident, Vec<(Option, Ident)>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parsergen/src/parser/input.rs:149:5 [INFO] [stdout] | [INFO] [stdout] 149 | Ok(body.parse()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 149 - Ok(body.parse()?) [INFO] [stdout] 149 + body.parse() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Some(ident) = x { [INFO] [stdout] 36 | | Some(ident.to_string()) [INFO] [stdout] 37 | | } else { [INFO] [stdout] 38 | | None [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________________^ help: try: `x.as_ref().map(|ident| ident.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:75:31 [INFO] [stdout] | [INFO] [stdout] 75 | tokens.iter().enumerate().map(|(i, typed)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 76 | | let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 | | [INFO] [stdout] 78 | | let i = i + 1; [INFO] [stdout] ... | [INFO] [stdout] 85 | | }).flatten().collect() [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] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 75 ~ tokens.iter().enumerate().flat_map(|(i, typed)| { [INFO] [stdout] 76 + let ident = Ident::new(typed.0.to_string().as_str(), Span::mixed_site()); [INFO] [stdout] 77 + [INFO] [stdout] 78 + let i = i + 1; [INFO] [stdout] 79 + let ty = &typed.1; [INFO] [stdout] 80 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 81 + [INFO] [stdout] 82 + quote! { [INFO] [stdout] 83 + fn #ident<#src_lifetime>(x: #ty) -> (usize, #holder_ident<#src_lifetime>) {(#i, #holder_ident::#ident(x))} [INFO] [stdout] 84 + } [INFO] [stdout] 85 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `proc_macro2::TokenStream` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:92:30 [INFO] [stdout] | [INFO] [stdout] 92 | let e: TokenStream = (quote! {#ident(#ty)}).into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `quote! {#ident(#ty)}` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:96:31 [INFO] [stdout] | [INFO] [stdout] 96 | let intos = tokens.iter().map(|(ident, ty)| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 97 | | let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 | | quote! { [INFO] [stdout] 99 | | fn #into_name(self) -> #ty { [INFO] [stdout] ... | [INFO] [stdout] 106 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 96 ~ let intos = tokens.iter().flat_map(|(ident, ty)| { [INFO] [stdout] 97 + let into_name = Ident::new(&format!("into_{}", ident), Span::mixed_site()); [INFO] [stdout] 98 + quote! { [INFO] [stdout] 99 + fn #into_name(self) -> #ty { [INFO] [stdout] 100 + match self { [INFO] [stdout] 101 + #holder_ident::#ident(x) => x, [INFO] [stdout] 102 + _ => panic!() [INFO] [stdout] 103 + } [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } [INFO] [stdout] 106 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:122:30 [INFO] [stdout] | [INFO] [stdout] 122 | rules.iter().enumerate().map(|(i, rule)| { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 123 | | let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 | | let span_ty = &types_info.span_ty; [INFO] [stdout] 125 | | let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] ... | [INFO] [stdout] 168 | | }).flatten().collect() [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 122 ~ rules.iter().enumerate().flat_map(|(i, rule)| { [INFO] [stdout] 123 + let src_lifetime = &types_info.src_lifetime; [INFO] [stdout] 124 + let span_ty = &types_info.span_ty; [INFO] [stdout] 125 + let holder_ident = Ident::new("Holder", Span::mixed_site()); [INFO] [stdout] 126 + let fn_ident = Ident::new(&format!("rule_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 127 + let fn_return_type = token_types.get(&rule.token.to_string()).unwrap(); [INFO] [stdout] 128 + let fn_return_variant = Ident::new(&format!("{}", rule.token), Span::mixed_site()); [INFO] [stdout] 129 + let closure_ident = Ident::new(&format!("prod_{}", i + 1), Span::mixed_site()); [INFO] [stdout] 130 + let body = &rule.block.contents; [INFO] [stdout] 131 + [INFO] [stdout] 132 + let span_ident = Ident::new("span", Span::mixed_site()); [INFO] [stdout] 133 + [INFO] [stdout] 134 + let args_decl = rule.expand.iter().filter_map(|(x, ident)| { [INFO] [stdout] 135 + if let Some(arg_ident) = x { [INFO] [stdout] 136 + let token = ident.to_string(); [INFO] [stdout] 137 + let ty = token_types.get(&token).unwrap(); [INFO] [stdout] 138 + let arg_name = Ident::new(&arg_ident.to_string(), Span::mixed_site()); [INFO] [stdout] 139 + let exp: TokenStream = quote! { [INFO] [stdout] 140 + #arg_name: #ty [INFO] [stdout] 141 + }; [INFO] [stdout] 142 + Some(exp) [INFO] [stdout] 143 + } else { [INFO] [stdout] 144 + None [INFO] [stdout] 145 + } [INFO] [stdout] 146 + }); [INFO] [stdout] 147 + [INFO] [stdout] 148 + let args_getters = rule.expand.iter().enumerate().filter_map(|(i, (x, ident))| { [INFO] [stdout] 149 + if x.is_some() { [INFO] [stdout] 150 + let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] 151 + let exp: TokenStream = quote! { [INFO] [stdout] 152 + a[#i].take().unwrap().#into_name() [INFO] [stdout] 153 + }; [INFO] [stdout] 154 + Some(exp) [INFO] [stdout] 155 + } else { [INFO] [stdout] 156 + None [INFO] [stdout] 157 + } [INFO] [stdout] 158 + }); [INFO] [stdout] 159 + [INFO] [stdout] 160 + quote! { [INFO] [stdout] 161 + fn #fn_ident<#src_lifetime>(#span_ident: #span_ty, #(#args_decl),*) -> Result<#fn_return_type, String> { [INFO] [stdout] 162 + #body [INFO] [stdout] 163 + } [INFO] [stdout] 164 + [INFO] [stdout] 165 + let #closure_ident = |span: #span_ty, mut a: Vec>>| [INFO] [stdout] 166 + #fn_ident(span, #(#args_getters),*).map(|x| #holder_ident::#fn_return_variant(x)); [INFO] [stdout] 167 + } [INFO] [stdout] 168 ~ }).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:150:69 [INFO] [stdout] | [INFO] [stdout] 150 | let into_name = Ident::new(&format!("into_{}", ident.to_string()), Span::mixed_site()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:207:32 [INFO] [stdout] | [INFO] [stdout] 207 | let s_rules = rules.iter().map(|prod| { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 208 | | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] ... | [INFO] [stdout] 222 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 207 ~ let s_rules = rules.iter().flat_map(|prod| { [INFO] [stdout] 208 + let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 + }).flatten().collect::(); [INFO] [stdout] 214 + [INFO] [stdout] 215 + let symbol = prod.symbol; [INFO] [stdout] 216 + quote! { [INFO] [stdout] 217 + ::automata::parser::types::Production { [INFO] [stdout] 218 + symbol: #symbol, [INFO] [stdout] 219 + expand: vec!(#s_expand), [INFO] [stdout] 220 + }, [INFO] [stdout] 221 + } [INFO] [stdout] 222 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:208:43 [INFO] [stdout] | [INFO] [stdout] 208 | let s_expand = prod.expand.iter().map(|symbol| { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 209 | | match symbol { [INFO] [stdout] 210 | | types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 | | types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 | | } [INFO] [stdout] 213 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 208 ~ let s_expand = prod.expand.iter().flat_map(|symbol| { [INFO] [stdout] 209 + match symbol { [INFO] [stdout] 210 + types::Symbol::T(i) => quote! {::automata::parser::types::Symbol::T(#i), }, [INFO] [stdout] 211 + types::Symbol::N(i) => quote! {::automata::parser::types::Symbol::N(#i), }, [INFO] [stdout] 212 + } [INFO] [stdout] 213 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:224:34 [INFO] [stdout] | [INFO] [stdout] 224 | let s_states = states.iter().map(|(actions, gotos)| { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 225 | | let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] ... | [INFO] [stdout] 249 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 224 ~ let s_states = states.iter().flat_map(|(actions, gotos)| { [INFO] [stdout] 225 + let s_actions = actions.iter().map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 + }).flatten().collect::(); [INFO] [stdout] 234 + [INFO] [stdout] 235 + let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 + }).flatten().collect::(); [INFO] [stdout] 245 + [INFO] [stdout] 246 + quote! { [INFO] [stdout] 247 + v.push((vec!(#s_actions), vec!(#s_gotos))); [INFO] [stdout] 248 + } [INFO] [stdout] 249 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:225:40 [INFO] [stdout] | [INFO] [stdout] 225 | let s_actions = actions.iter().map(|action| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 226 | | match action { [INFO] [stdout] 227 | | Some(types::Action::Shift(i)) => [INFO] [stdout] 228 | | quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] ... | [INFO] [stdout] 233 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 225 ~ let s_actions = actions.iter().flat_map(|action| { [INFO] [stdout] 226 + match action { [INFO] [stdout] 227 + Some(types::Action::Shift(i)) => [INFO] [stdout] 228 + quote! {Some(::automata::parser::types::Action::Shift(#i)), }, [INFO] [stdout] 229 + Some(types::Action::Reduce(i)) => [INFO] [stdout] 230 + quote! {Some(::automata::parser::types::Action::Reduce(#i)), }, [INFO] [stdout] 231 + None => quote! {None, } [INFO] [stdout] 232 + } [INFO] [stdout] 233 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:235:36 [INFO] [stdout] | [INFO] [stdout] 235 | let s_gotos = gotos.iter().map(|goto| { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 236 | | match goto { [INFO] [stdout] 237 | | types::Goto::Accept => [INFO] [stdout] 238 | | quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] ... | [INFO] [stdout] 244 | | }).flatten().collect::(); [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 `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 235 ~ let s_gotos = gotos.iter().flat_map(|goto| { [INFO] [stdout] 236 + match goto { [INFO] [stdout] 237 + types::Goto::Accept => [INFO] [stdout] 238 + quote! {::automata::parser::types::Goto::Accept, }, [INFO] [stdout] 239 + types::Goto::Some(i) => [INFO] [stdout] 240 + quote! {::automata::parser::types::Goto::Some(#i), }, [INFO] [stdout] 241 + types::Goto::None => [INFO] [stdout] 242 + quote! {::automata::parser::types::Goto::None, } [INFO] [stdout] 243 + } [INFO] [stdout] 244 ~ }).collect::(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> parsergen/src/parser/macro_def.rs:30:26 [INFO] [stdout] | [INFO] [stdout] 30 | input.on_empty.check(&vec!())?; [INFO] [stdout] | ^^^^^^^ help: you can use a slice directly: `&[]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking parser v0.1.0 (/opt/rustwide/workdir/parser) [INFO] [stderr] Checking sim v0.1.0 (/opt/rustwide/workdir/sim) [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> sim/src/parsing/parser.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | Str(String), [INFO] [stdout] | --- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 24 - Str(String), [INFO] [stdout] 24 + Str(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `name` and `len` are never read [INFO] [stdout] --> sim/src/types.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 62 | pub struct VarInfo { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 63 | pub name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 67 | pub len: u32, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> sim/src/build_graph.rs:55:36 [INFO] [stdout] | [INFO] [stdout] 55 | let var = find_var(&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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:102:20 [INFO] [stdout] | [INFO] [stdout] 102 | if !(len == arg_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(len != arg_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:115:20 [INFO] [stdout] | [INFO] [stdout] 115 | if !(len == arg_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(len != arg_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:164:20 [INFO] [stdout] | [INFO] [stdout] 164 | if !(len == source_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `(len != source_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:250:20 [INFO] [stdout] | [INFO] [stdout] 250 | if !(/*0 <= *index &&*/ *index < src_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*index >= src_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:284:20 [INFO] [stdout] | [INFO] [stdout] 284 | if !(len == l_len + r_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(len != l_len + r_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> sim/src/build_graph.rs:212:27 [INFO] [stdout] | [INFO] [stdout] 212 | size: (2 as usize).pow(addr_len), [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> sim/src/build_graph.rs:243:27 [INFO] [stdout] | [INFO] [stdout] 243 | size: (2 as usize).pow(addr_len), [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> sim/src/runner.rs:152:34 [INFO] [stdout] | [INFO] [stdout] 152 | let res = if self.get_value(sel, 0) == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!self.get_value(sel, 0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> sim/src/main.rs:90:37 [INFO] [stdout] | [INFO] [stdout] 90 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:119:12 [INFO] [stdout] | [INFO] [stdout] 119 | if outputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `outputs.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: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:135:19 [INFO] [stdout] | [INFO] [stdout] 135 | } else if inputs.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!inputs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:144:12 [INFO] [stdout] | [INFO] [stdout] 144 | if inputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `inputs.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: casting a character literal to `u8` truncates [INFO] [stdout] --> sim/src/main.rs:147:43 [INFO] [stdout] | [INFO] [stdout] 147 | io::stdin().lock().read_until('\n' as u8, &mut vec!()).expect("IO error"); [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> sim/src/parsing/parser.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | Str(String), [INFO] [stdout] | --- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 24 - Str(String), [INFO] [stdout] 24 + Str(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `name` and `len` are never read [INFO] [stdout] --> sim/src/types.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 62 | pub struct VarInfo { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 63 | pub name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 67 | pub len: u32, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> sim/src/build_graph.rs:55:36 [INFO] [stdout] | [INFO] [stdout] 55 | let var = find_var(&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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:102:20 [INFO] [stdout] | [INFO] [stdout] 102 | if !(len == arg_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(len != arg_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:115:20 [INFO] [stdout] | [INFO] [stdout] 115 | if !(len == arg_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(len != arg_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:164:20 [INFO] [stdout] | [INFO] [stdout] 164 | if !(len == source_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `(len != source_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:250:20 [INFO] [stdout] | [INFO] [stdout] 250 | if !(/*0 <= *index &&*/ *index < src_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*index >= src_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> sim/src/build_graph.rs:284:20 [INFO] [stdout] | [INFO] [stdout] 284 | if !(len == l_len + r_len) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(len != l_len + r_len)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> sim/src/build_graph.rs:212:27 [INFO] [stdout] | [INFO] [stdout] 212 | size: (2 as usize).pow(addr_len), [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> sim/src/build_graph.rs:243:27 [INFO] [stdout] | [INFO] [stdout] 243 | size: (2 as usize).pow(addr_len), [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> sim/src/runner.rs:152:34 [INFO] [stdout] | [INFO] [stdout] 152 | let res = if self.get_value(sel, 0) == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!self.get_value(sel, 0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> sim/src/main.rs:90:37 [INFO] [stdout] | [INFO] [stdout] 90 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:119:12 [INFO] [stdout] | [INFO] [stdout] 119 | if outputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `outputs.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: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:135:19 [INFO] [stdout] | [INFO] [stdout] 135 | } else if inputs.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!inputs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> sim/src/main.rs:144:12 [INFO] [stdout] | [INFO] [stdout] 144 | if inputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `inputs.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: casting a character literal to `u8` truncates [INFO] [stdout] --> sim/src/main.rs:147:43 [INFO] [stdout] | [INFO] [stdout] 147 | io::stdin().lock().read_until('\n' as u8, &mut vec!()).expect("IO error"); [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> parser/src/typing/main.rs:11:11 [INFO] [stdout] | [INFO] [stdout] 11 | known.into_iter().map(|t| (t.clone(), vec![EnvVariable::init()])).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] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/main.rs:64:36 [INFO] [stdout] | [INFO] [stdout] 64 | verify_implicit_return(&func)?; [INFO] [stdout] | ^^^^^ help: change this to: `func` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/data.rs:17:34 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn is_builtin_function(name: &String) -> bool { [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] 17 ~ pub fn is_builtin_function(name: &str) -> bool { [INFO] [stdout] 18 ~ match name { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/data.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / match name.as_str() { [INFO] [stdout] 19 | | "println" | "div" | "print" => true, [INFO] [stdout] 20 | | _ => false [INFO] [stdout] 21 | | } [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] 18 - match name.as_str() { [INFO] [stdout] 19 - "println" | "div" | "print" => true, [INFO] [stdout] 20 - _ => false [INFO] [stdout] 21 - } [INFO] [stdout] 18 + matches!(name.as_str(), "println" | "div" | "print") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:129:26 [INFO] [stdout] | [INFO] [stdout] 129 | self.push_to_env(&ident, StaticType::Any, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/data.rs:133:61 [INFO] [stdout] | [INFO] [stdout] 133 | idents.iter().for_each(|var| self.push_local_to_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [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] --> parser/src/typing/data.rs:145:20 [INFO] [stdout] | [INFO] [stdout] 145 | if types.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `types.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:153:56 [INFO] [stdout] | [INFO] [stdout] 153 | idents.iter().for_each(|var| self.pop_from_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:159:27 [INFO] [stdout] | [INFO] [stdout] 159 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 160 | | None => None, [INFO] [stdout] 161 | | Some(var) => Some(var.ty.clone()) [INFO] [stdout] 162 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.ty.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 170 | | None => None, [INFO] [stdout] 171 | | Some(var) => Some(var.scope) [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.scope)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&ident.name).is_some()` [INFO] [stdout] --> parser/src/typing/data.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | self.environment.get(&ident.name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&ident.name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:14:64 [INFO] [stdout] | [INFO] [stdout] 14 | ElseVal::ElseIf(e, b, rest_) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | .chain(collect_all_assign_in_array(&b.val).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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 16 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:17:24 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).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] 17 - .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] 17 + .chain(collect_else(&rest_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:17:37 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/assign.rs:26:43 [INFO] [stdout] | [INFO] [stdout] 26 | Some(e) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut assigns = collect_all_assign(&e); [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / match lv.in_exp { [INFO] [stdout] 31 | | None => assigns.push(LocatedIdent::new( [INFO] [stdout] 32 | | lv.span, [INFO] [stdout] 33 | | lv.name.clone())), [INFO] [stdout] 34 | | _ => {} [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 ~ if let None = lv.in_exp { assigns.push(LocatedIdent::new( [INFO] [stdout] 31 + lv.span, [INFO] [stdout] 32 ~ lv.name.clone())) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:38:61 [INFO] [stdout] | [INFO] [stdout] 38 | ExpVal::BinOp(_, alpha, beta) => collect_all_assign(&alpha) [INFO] [stdout] | ^^^^^^ help: change this to: `alpha` [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] --> parser/src/typing/assign.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).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] 40 - .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] 40 + .chain(collect_all_assign(&beta)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] | ^^^^^ help: change this to: `beta` [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] --> parser/src/typing/assign.rs:42:53 [INFO] [stdout] | [INFO] [stdout] 42 | ExpVal::UnaryOp(_, e) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:43:61 [INFO] [stdout] | [INFO] [stdout] 43 | ExpVal::Call(_, e_s) => collect_all_assign_in_array(&e_s), [INFO] [stdout] | ^^^^ help: change this to: `e_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] --> parser/src/typing/assign.rs:45:50 [INFO] [stdout] | [INFO] [stdout] 45 | ExpVal::RMul(e, _) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:46:61 [INFO] [stdout] | [INFO] [stdout] 46 | ExpVal::If(e, b, else_branch) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | .chain(collect_all_assign_in_array(&b.val).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] 48 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 48 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).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] 49 - .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] 49 + .chain(collect_else(&else_branch)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:49:33 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `else_branch` [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] --> parser/src/typing/returns.rs:41:36 [INFO] [stdout] | [INFO] [stdout] 41 | visit_else_returns(&rest_, expected)?; [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/returns.rs:52:27 [INFO] [stdout] | [INFO] [stdout] 52 | visit_returns(&a, expected)?; [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/returns.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | visit_returns(&b, expected)?; [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/phase1.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | fn is_reserved_name(n: &String) -> bool { [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] 8 ~ fn is_reserved_name(n: &str) -> bool { [INFO] [stdout] 9 ~ match n { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/phase1.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / match n.as_str() { [INFO] [stdout] 10 | | "div" | "print" | "println" => true, [INFO] [stdout] 11 | | _ => false [INFO] [stdout] 12 | | } [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] 9 - match n.as_str() { [INFO] [stdout] 10 - "div" | "print" | "println" => true, [INFO] [stdout] 11 - _ => false [INFO] [stdout] 12 - } [INFO] [stdout] 9 + matches!(n.as_str(), "div" | "print" | "println") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:37:34 [INFO] [stdout] | [INFO] [stdout] 37 | ...n, format!("This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before").to... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before".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: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | ...aram.span, format!("This type is malformed, either it is not a primitive or it's not a declared before structure").to_string()).i... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive or it's not a declared before structure".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/phase1.rs:97:94 [INFO] [stdout] | [INFO] [stdout] 97 | if is_callable_with_exactly(f.params.iter().map(|arg| arg.ty.clone()).collect(), &sig) { [INFO] [stdout] | ^^^^ help: change this to: `sig` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:14:65 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [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] 14 - pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [INFO] [stdout] 14 + pub fn is_this_call_ambiguous(args: Vec, functions: &[FuncSignature]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:50 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:47:70 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [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] 47 - pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [INFO] [stdout] 47 + pub fn compute_ambiguous_signature(args: Vec, functions: &[FuncSignature]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:67 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:100 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:75:43 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [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] 75 - pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [INFO] [stdout] 75 + pub fn compute_selectivity_weight(params: &[StaticType], target_sig: &FuncSignature) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:87:10 [INFO] [stdout] | [INFO] [stdout] 87 | .into_iter() [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: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [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] 10 - return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [INFO] [stdout] 10 + alpha.static_ty == StaticType::Any || alpha.static_ty == t [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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] 18 - return ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] 18 + ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> parser/src/typing/fill.rs:18:15 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:82:75 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(ty) = tcx.get_potentially_unique_return_type_for_function(&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: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | ... (span.clone(), format!("Ambiguous call to function '{} ({})', cannot be resolve at runtime through dynamic dispatch", &name, [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> parser/src/typing/fill.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | ... compute_ambiguous_signature(st_args, &tcx.functions[name]).and_then(|s| Some(format_signature(s))).unwrap_or("no inf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `compute_ambiguous_signature(st_args, &tcx.functions[name]).map(|s| format_signature(s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:126:14 [INFO] [stdout] | [INFO] [stdout] 126 | (span.clone(), format!("Field '{}' does not exist for the type '{}'", name, prefix_e.static_ty).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:136:18 [INFO] [stdout] | [INFO] [stdout] 136 | (span.clone(), format!("Field '{}' is not declared anywhere in any structure", name).to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | ... (span.clone(), format!("Field '{}' is not contained in a mutable structure, it cannot be assigned", name).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:196:35 [INFO] [stdout] | [INFO] [stdout] 196 | if !is_any_or(&a, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:200:35 [INFO] [stdout] | [INFO] [stdout] 200 | if !is_any_or(&b, StaticType::Int64) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:212:42 [INFO] [stdout] | [INFO] [stdout] 212 | if !is_one_of_or_any(&a, &admissible_types) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:215:42 [INFO] [stdout] | [INFO] [stdout] 215 | if !is_one_of_or_any(&b, &admissible_types) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:222:35 [INFO] [stdout] | [INFO] [stdout] 222 | if !is_any_or(&a, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:226:35 [INFO] [stdout] | [INFO] [stdout] 226 | if !is_any_or(&b, StaticType::Bool) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:239:35 [INFO] [stdout] | [INFO] [stdout] 239 | if !is_any_or(&e, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/fill.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | if !is_any_or(&e, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `e` [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 use of `format!` [INFO] [stdout] --> parser/src/typing/fill.rs:257:41 [INFO] [stdout] | [INFO] [stdout] 257 | ... (expr.span, format!("`div` was called here with less or more than two arguments!").to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"`div` was called here with less or more than two arguments!".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:379:29 [INFO] [stdout] | [INFO] [stdout] 379 | tcx.push_to_env(&ident, StaticType::Int64, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/fill.rs:385:30 [INFO] [stdout] | [INFO] [stdout] 385 | tcx.pop_from_env(&ident); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parser/src/parse.rs:824:5 [INFO] [stdout] | [INFO] [stdout] 824 | Ok(ast?) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 824 - Ok(ast?) [INFO] [stdout] 824 + ast [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> parser/src/typing/main.rs:11:11 [INFO] [stdout] | [INFO] [stdout] 11 | known.into_iter().map(|t| (t.clone(), vec![EnvVariable::init()])).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] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/main.rs:64:36 [INFO] [stdout] | [INFO] [stdout] 64 | verify_implicit_return(&func)?; [INFO] [stdout] | ^^^^^ help: change this to: `func` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/data.rs:17:34 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn is_builtin_function(name: &String) -> bool { [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] 17 ~ pub fn is_builtin_function(name: &str) -> bool { [INFO] [stdout] 18 ~ match name { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/data.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / match name.as_str() { [INFO] [stdout] 19 | | "println" | "div" | "print" => true, [INFO] [stdout] 20 | | _ => false [INFO] [stdout] 21 | | } [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] 18 - match name.as_str() { [INFO] [stdout] 19 - "println" | "div" | "print" => true, [INFO] [stdout] 20 - _ => false [INFO] [stdout] 21 - } [INFO] [stdout] 18 + matches!(name.as_str(), "println" | "div" | "print") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:129:26 [INFO] [stdout] | [INFO] [stdout] 129 | self.push_to_env(&ident, StaticType::Any, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/data.rs:133:61 [INFO] [stdout] | [INFO] [stdout] 133 | idents.iter().for_each(|var| self.push_local_to_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [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] --> parser/src/typing/data.rs:145:20 [INFO] [stdout] | [INFO] [stdout] 145 | if types.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `types.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:153:56 [INFO] [stdout] | [INFO] [stdout] 153 | idents.iter().for_each(|var| self.pop_from_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:159:27 [INFO] [stdout] | [INFO] [stdout] 159 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 160 | | None => None, [INFO] [stdout] 161 | | Some(var) => Some(var.ty.clone()) [INFO] [stdout] 162 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.ty.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 170 | | None => None, [INFO] [stdout] 171 | | Some(var) => Some(var.scope) [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.scope)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&ident.name).is_some()` [INFO] [stdout] --> parser/src/typing/data.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | self.environment.get(&ident.name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&ident.name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:14:64 [INFO] [stdout] | [INFO] [stdout] 14 | ElseVal::ElseIf(e, b, rest_) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | .chain(collect_all_assign_in_array(&b.val).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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 16 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:17:24 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).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] 17 - .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] 17 + .chain(collect_else(&rest_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:17:37 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/assign.rs:26:43 [INFO] [stdout] | [INFO] [stdout] 26 | Some(e) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut assigns = collect_all_assign(&e); [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / match lv.in_exp { [INFO] [stdout] 31 | | None => assigns.push(LocatedIdent::new( [INFO] [stdout] 32 | | lv.span, [INFO] [stdout] 33 | | lv.name.clone())), [INFO] [stdout] 34 | | _ => {} [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 ~ if let None = lv.in_exp { assigns.push(LocatedIdent::new( [INFO] [stdout] 31 + lv.span, [INFO] [stdout] 32 ~ lv.name.clone())) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:38:61 [INFO] [stdout] | [INFO] [stdout] 38 | ExpVal::BinOp(_, alpha, beta) => collect_all_assign(&alpha) [INFO] [stdout] | ^^^^^^ help: change this to: `alpha` [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] --> parser/src/typing/assign.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).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] 40 - .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] 40 + .chain(collect_all_assign(&beta)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] | ^^^^^ help: change this to: `beta` [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] --> parser/src/typing/assign.rs:42:53 [INFO] [stdout] | [INFO] [stdout] 42 | ExpVal::UnaryOp(_, e) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:43:61 [INFO] [stdout] | [INFO] [stdout] 43 | ExpVal::Call(_, e_s) => collect_all_assign_in_array(&e_s), [INFO] [stdout] | ^^^^ help: change this to: `e_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] --> parser/src/typing/assign.rs:45:50 [INFO] [stdout] | [INFO] [stdout] 45 | ExpVal::RMul(e, _) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:46:61 [INFO] [stdout] | [INFO] [stdout] 46 | ExpVal::If(e, b, else_branch) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | .chain(collect_all_assign_in_array(&b.val).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] 48 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 48 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).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] 49 - .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] 49 + .chain(collect_else(&else_branch)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:49:33 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `else_branch` [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] --> parser/src/typing/returns.rs:41:36 [INFO] [stdout] | [INFO] [stdout] 41 | visit_else_returns(&rest_, expected)?; [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/returns.rs:52:27 [INFO] [stdout] | [INFO] [stdout] 52 | visit_returns(&a, expected)?; [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/returns.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | visit_returns(&b, expected)?; [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/phase1.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | fn is_reserved_name(n: &String) -> bool { [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] 8 ~ fn is_reserved_name(n: &str) -> bool { [INFO] [stdout] 9 ~ match n { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/phase1.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / match n.as_str() { [INFO] [stdout] 10 | | "div" | "print" | "println" => true, [INFO] [stdout] 11 | | _ => false [INFO] [stdout] 12 | | } [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] 9 - match n.as_str() { [INFO] [stdout] 10 - "div" | "print" | "println" => true, [INFO] [stdout] 11 - _ => false [INFO] [stdout] 12 - } [INFO] [stdout] 9 + matches!(n.as_str(), "div" | "print" | "println") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:37:34 [INFO] [stdout] | [INFO] [stdout] 37 | ...n, format!("This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before").to... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before".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: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | ...aram.span, format!("This type is malformed, either it is not a primitive or it's not a declared before structure").to_string()).i... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive or it's not a declared before structure".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/phase1.rs:97:94 [INFO] [stdout] | [INFO] [stdout] 97 | if is_callable_with_exactly(f.params.iter().map(|arg| arg.ty.clone()).collect(), &sig) { [INFO] [stdout] | ^^^^ help: change this to: `sig` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:14:65 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [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] 14 - pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [INFO] [stdout] 14 + pub fn is_this_call_ambiguous(args: Vec, functions: &[FuncSignature]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:50 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:47:70 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [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] 47 - pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [INFO] [stdout] 47 + pub fn compute_ambiguous_signature(args: Vec, functions: &[FuncSignature]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:67 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:100 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:75:43 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [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] 75 - pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [INFO] [stdout] 75 + pub fn compute_selectivity_weight(params: &[StaticType], target_sig: &FuncSignature) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:87:10 [INFO] [stdout] | [INFO] [stdout] 87 | .into_iter() [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: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [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] 10 - return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [INFO] [stdout] 10 + alpha.static_ty == StaticType::Any || alpha.static_ty == t [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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] 18 - return ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] 18 + ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> parser/src/typing/fill.rs:18:15 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:82:75 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(ty) = tcx.get_potentially_unique_return_type_for_function(&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: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | ... (span.clone(), format!("Ambiguous call to function '{} ({})', cannot be resolve at runtime through dynamic dispatch", &name, [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> parser/src/typing/fill.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | ... compute_ambiguous_signature(st_args, &tcx.functions[name]).and_then(|s| Some(format_signature(s))).unwrap_or("no inf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `compute_ambiguous_signature(st_args, &tcx.functions[name]).map(|s| format_signature(s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:126:14 [INFO] [stdout] | [INFO] [stdout] 126 | (span.clone(), format!("Field '{}' does not exist for the type '{}'", name, prefix_e.static_ty).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:136:18 [INFO] [stdout] | [INFO] [stdout] 136 | (span.clone(), format!("Field '{}' is not declared anywhere in any structure", name).to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | ... (span.clone(), format!("Field '{}' is not contained in a mutable structure, it cannot be assigned", name).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:196:35 [INFO] [stdout] | [INFO] [stdout] 196 | if !is_any_or(&a, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:200:35 [INFO] [stdout] | [INFO] [stdout] 200 | if !is_any_or(&b, StaticType::Int64) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:212:42 [INFO] [stdout] | [INFO] [stdout] 212 | if !is_one_of_or_any(&a, &admissible_types) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:215:42 [INFO] [stdout] | [INFO] [stdout] 215 | if !is_one_of_or_any(&b, &admissible_types) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:222:35 [INFO] [stdout] | [INFO] [stdout] 222 | if !is_any_or(&a, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:226:35 [INFO] [stdout] | [INFO] [stdout] 226 | if !is_any_or(&b, StaticType::Bool) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:239:35 [INFO] [stdout] | [INFO] [stdout] 239 | if !is_any_or(&e, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/fill.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | if !is_any_or(&e, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `e` [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 use of `format!` [INFO] [stdout] --> parser/src/typing/fill.rs:257:41 [INFO] [stdout] | [INFO] [stdout] 257 | ... (expr.span, format!("`div` was called here with less or more than two arguments!").to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"`div` was called here with less or more than two arguments!".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:379:29 [INFO] [stdout] | [INFO] [stdout] 379 | tcx.push_to_env(&ident, StaticType::Int64, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/fill.rs:385:30 [INFO] [stdout] | [INFO] [stdout] 385 | tcx.pop_from_env(&ident); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parser/src/parse.rs:824:5 [INFO] [stdout] | [INFO] [stdout] 824 | Ok(ast?) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 824 - Ok(ast?) [INFO] [stdout] 824 + ast [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/lib.rs:15:34 [INFO] [stdout] | [INFO] [stdout] 15 | static_type(parse(file_name, &contents).map_err(|e| e.to_string())?).map_err(|e| e.to_string()) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `contents` [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] --> parser/src/lib.rs:15:34 [INFO] [stdout] | [INFO] [stdout] 15 | static_type(parse(file_name, &contents).map_err(|e| e.to_string())?).map_err(|e| e.to_string()) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `contents` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking ir v0.1.0 (/opt/rustwide/workdir/ir) [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> ir/src/ast_to_hir.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> ir/src/ast_to_hir.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `reset` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 27 | impl Renamer { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 54 | fn reset(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `emit_unique_gvar_name` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:214:8 [INFO] [stdout] | [INFO] [stdout] 87 | impl Emitter { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 214 | fn emit_unique_gvar_name(&mut self, gvar: &String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Punct` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Punct { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Token` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:42:6 [INFO] [stdout] | [INFO] [stdout] 42 | enum Token { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_lir` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn parse_lir<'a>(file_name: &'a str, contents: &'a str) -> Result> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Punct` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Punct { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Token` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:43:6 [INFO] [stdout] | [INFO] [stdout] 43 | enum Token { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_hir` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:50:8 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn parse_hir<'a>(file_name: &'a str, contents: &'a str) -> Result> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> ir/src/ast_to_hir.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / match n { [INFO] [stdout] 72 | | "pow" => true, [INFO] [stdout] 73 | | _ => false [INFO] [stdout] 74 | | } [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] 71 - match n { [INFO] [stdout] 72 - "pow" => true, [INFO] [stdout] 73 - _ => false [INFO] [stdout] 74 - } [INFO] [stdout] 71 + matches!(n, "pow") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | fn emit_panic_call(&mut self, out: &String, message: &str) -> HIRStatementsResult { [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] 100 ~ fn emit_panic_call(&mut self, out: &str, message: &str) -> HIRStatementsResult { [INFO] [stdout] 101 ~ Ok(vec![hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> ir/src/ast_to_hir.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 152 - body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [INFO] [stdout] 152 + body = body.merge(variants.into_iter().zip(cond_vars).fold( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:45 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &str, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 178 | stmts.push( [INFO] [stdout] 179 ~ hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:64 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &String, fun_name: &str, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 179 | hir::Statement::Call(self.renamer.get_lvalue(out.clone()), [INFO] [stdout] 180 ~ hir::Callable::Call(fun_name.to_owned(), native, vec![arg.clone()])) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:189:51 [INFO] [stdout] | [INFO] [stdout] 189 | let mut stmts = self.unpack_variadic_call(&tmp, &"print".to_string(), false, args)?; [INFO] [stdout] | ^^^^ help: change this to: `tmp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:200:89 [INFO] [stdout] | [INFO] [stdout] 200 | Ok(vec![self.emit_print_function()?, self.emit_div_function()?].into_iter().map(|fun| hir::Decl::Function(fun)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `hir::Decl::Function` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:246:67 [INFO] [stdout] | [INFO] [stdout] 246 | let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:331:75 [INFO] [stdout] | [INFO] [stdout] 331 | ... let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:372:56 [INFO] [stdout] | [INFO] [stdout] 372 | let (mut stmts, val) = self.emit_value(&exp)?; [INFO] [stdout] | ^^^^ help: change this to: `exp` [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] --> ir/src/ast_to_hir.rs:415:70 [INFO] [stdout] | [INFO] [stdout] 415 | stmts.extend(self.unpack_variadic_call(&out, &name, false, &vals)?); [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] --> ir/src/ast_to_hir.rs:419:82 [INFO] [stdout] | [INFO] [stdout] 419 | ... hir::Callable::Call(name.clone(), is_native_function(&name), vals)) [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] --> ir/src/ast_to_hir.rs:465:65 [INFO] [stdout] | [INFO] [stdout] 465 | let (stmts_lv, val_lv) = self.emit_lvalue_value(&lv)?; [INFO] [stdout] | ^^^ help: change this to: `lv` [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] --> ir/src/ast_to_hir.rs:488:66 [INFO] [stdout] | [INFO] [stdout] 488 | let (mut stmts, value) = self.emit_value(&expr)?; [INFO] [stdout] | ^^^^^ help: change this to: `expr` [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] --> ir/src/ast_to_hir.rs:499:37 [INFO] [stdout] | [INFO] [stdout] 499 | self.emit_block(&then, false)?, [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:500:42 [INFO] [stdout] | [INFO] [stdout] 500 | self.emit_else_block(&else_)? [INFO] [stdout] | ^^^^^^ help: change this to: `else_` [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] --> ir/src/ast_to_hir.rs:535:63 [INFO] [stdout] | [INFO] [stdout] 535 | body_block = body_block.merge(self.emit_block(&body, false)?); [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:546:62 [INFO] [stdout] | [INFO] [stdout] 546 | let (stmts_cond, val_cond) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:547:54 [INFO] [stdout] | [INFO] [stdout] 547 | let mut while_body = self.emit_block(&body, false)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:557:58 [INFO] [stdout] | [INFO] [stdout] 557 | let (mut stmts, vals) = self.emit_values(&args)?; [INFO] [stdout] | ^^^^^ help: change this to: `args` [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] --> ir/src/ast_to_hir.rs:563:66 [INFO] [stdout] | [INFO] [stdout] 563 | stmts.extend(self.unpack_variadic_call(&tmp, &f_name, false, &vals)?); [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:567:80 [INFO] [stdout] | [INFO] [stdout] 567 | hir::Callable::Call(f_name.clone(), is_native_function(&f_name), vals), [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:575:63 [INFO] [stdout] | [INFO] [stdout] 575 | None => self.emit_global_assign(&lv.name, &e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> ir/src/ast_to_hir.rs:576:79 [INFO] [stdout] | [INFO] [stdout] 576 | Some(p_exp) => self.emit_composed_assign(p_exp, &lv.name, &e) [INFO] [stdout] | ^^ help: change this to: `e` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:616:73 [INFO] [stdout] | [INFO] [stdout] 616 | fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &String, rhs_expr: &Exp) -> HIRStatementsResult { [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] 616 ~ fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &str, rhs_expr: &Exp) -> HIRStatementsResult { [INFO] [stdout] 617 | let (mut stmts, struct_val) = self.emit_value(structure_exp)?; [INFO] [stdout] ... [INFO] [stdout] 635 | hir::Statement::Call( [INFO] [stdout] 636 ~ hir::LValue::Access(struct_val, struct_name.clone(), field_name.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:661:50 [INFO] [stdout] | [INFO] [stdout] 661 | exps.iter().map(|e| self.emit_statements(&e)).flat_map(|result| match result { [INFO] [stdout] | ^^ help: change this to: `e` [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: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:662:48 [INFO] [stdout] | [INFO] [stdout] 662 | Ok(stmts) => stmts.into_iter().map(|item| Ok(item)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> ir/src/ast_to_hir.rs:676:13 [INFO] [stdout] | [INFO] [stdout] 676 | / self.emit_flattened_statements(&b.val) [INFO] [stdout] 677 | | .and_then(|stmts| Ok(hir::Block::new(stmts))) [INFO] [stdout] | |_________________________________________________________^ help: try: `self.emit_flattened_statements(&b.val).map(|stmts| hir::Block::new(stmts))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:684:53 [INFO] [stdout] | [INFO] [stdout] 684 | ElseVal::Else(block) => self.emit_block(&block, false), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:686:61 [INFO] [stdout] | [INFO] [stdout] 686 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:689:66 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:689:103 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^^^ help: change this to: `else__` [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] --> ir/src/ast_to_hir.rs:700:59 [INFO] [stdout] | [INFO] [stdout] 700 | ElseVal::Else(block) => self.emit_block_value(&block), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:703:61 [INFO] [stdout] | [INFO] [stdout] 703 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:813:62 [INFO] [stdout] | [INFO] [stdout] 813 | weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [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] 813 - weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] 813 + weights[index] = f.params.iter().map(|param| if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> ir/src/ast_to_hir.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | (0..variants).into_iter().map(|i| format!("{}_{}", name, i)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..variants)` [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(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:131:14 [INFO] [stdout] | [INFO] [stdout] 131 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 132 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 206 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/hir_to_lir.rs:542:40 [INFO] [stdout] | [INFO] [stdout] 542 | let mut local = LocalRegistry::new(&global, &vars_and_params); [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/hir_to_lir.rs:554:54 [INFO] [stdout] | [INFO] [stdout] 554 | let mut statements = compile_block(&mut lbl_gen, &global, &mut local, &f.body)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/lir_to_asm.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | f.body.stmts.iter().for_each(|stmt| match stmt { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 63 | | Statement::Label(label) => { [INFO] [stdout] 64 | | recv.recv_label(&label.name) [INFO] [stdout] 65 | | }, [INFO] [stdout] 66 | | _ => () [INFO] [stdout] 67 | | }); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 ~ f.body.stmts.iter().for_each(|stmt| if let Statement::Label(label) = stmt { [INFO] [stdout] 63 + recv.recv_label(&label.name) [INFO] [stdout] 64 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:273:44 [INFO] [stdout] | [INFO] [stdout] 273 | .chain(args.iter().map(|a| UsrOrNative::Usr(a))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:276:33 [INFO] [stdout] | [INFO] [stdout] 276 | args.iter().map(|a| UsrOrNative::Usr(a)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:280:24 [INFO] [stdout] | [INFO] [stdout] 280 | if (args.len() - 6) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(args.len() - 6).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:388:29 [INFO] [stdout] | [INFO] [stdout] 388 | let frame_size = 8 * if var_count % 2 == 0 {var_count} else {var_count + 1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `var_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:124:21 [INFO] [stdout] | [INFO] [stdout] 124 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:157:21 [INFO] [stdout] | [INFO] [stdout] 157 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", arg) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:218:21 [INFO] [stdout] | [INFO] [stdout] 218 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: method `reset` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 27 | impl Renamer { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 54 | fn reset(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `emit_unique_gvar_name` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:214:8 [INFO] [stdout] | [INFO] [stdout] 87 | impl Emitter { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 214 | fn emit_unique_gvar_name(&mut self, gvar: &String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Punct` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Punct { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Token` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:42:6 [INFO] [stdout] | [INFO] [stdout] 42 | enum Token { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_lir` is never used [INFO] [stdout] --> ir/src/lir/parsing.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn parse_lir<'a>(file_name: &'a str, contents: &'a str) -> Result> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Punct` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Punct { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Token` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:43:6 [INFO] [stdout] | [INFO] [stdout] 43 | enum Token { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_hir` is never used [INFO] [stdout] --> ir/src/hir/parsing.rs:50:8 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn parse_hir<'a>(file_name: &'a str, contents: &'a str) -> Result> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> ir/src/ast_to_hir.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / match n { [INFO] [stdout] 72 | | "pow" => true, [INFO] [stdout] 73 | | _ => false [INFO] [stdout] 74 | | } [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] 71 - match n { [INFO] [stdout] 72 - "pow" => true, [INFO] [stdout] 73 - _ => false [INFO] [stdout] 74 - } [INFO] [stdout] 71 + matches!(n, "pow") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | fn emit_panic_call(&mut self, out: &String, message: &str) -> HIRStatementsResult { [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] 100 ~ fn emit_panic_call(&mut self, out: &str, message: &str) -> HIRStatementsResult { [INFO] [stdout] 101 ~ Ok(vec![hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> ir/src/ast_to_hir.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 152 - body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [INFO] [stdout] 152 + body = body.merge(variants.into_iter().zip(cond_vars).fold( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:45 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &str, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 178 | stmts.push( [INFO] [stdout] 179 ~ hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:64 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &String, fun_name: &str, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 179 | hir::Statement::Call(self.renamer.get_lvalue(out.clone()), [INFO] [stdout] 180 ~ hir::Callable::Call(fun_name.to_owned(), native, vec![arg.clone()])) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:189:51 [INFO] [stdout] | [INFO] [stdout] 189 | let mut stmts = self.unpack_variadic_call(&tmp, &"print".to_string(), false, args)?; [INFO] [stdout] | ^^^^ help: change this to: `tmp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:200:89 [INFO] [stdout] | [INFO] [stdout] 200 | Ok(vec![self.emit_print_function()?, self.emit_div_function()?].into_iter().map(|fun| hir::Decl::Function(fun)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `hir::Decl::Function` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:246:67 [INFO] [stdout] | [INFO] [stdout] 246 | let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:331:75 [INFO] [stdout] | [INFO] [stdout] 331 | ... let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:372:56 [INFO] [stdout] | [INFO] [stdout] 372 | let (mut stmts, val) = self.emit_value(&exp)?; [INFO] [stdout] | ^^^^ help: change this to: `exp` [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] --> ir/src/ast_to_hir.rs:415:70 [INFO] [stdout] | [INFO] [stdout] 415 | stmts.extend(self.unpack_variadic_call(&out, &name, false, &vals)?); [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] --> ir/src/ast_to_hir.rs:419:82 [INFO] [stdout] | [INFO] [stdout] 419 | ... hir::Callable::Call(name.clone(), is_native_function(&name), vals)) [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] --> ir/src/ast_to_hir.rs:465:65 [INFO] [stdout] | [INFO] [stdout] 465 | let (stmts_lv, val_lv) = self.emit_lvalue_value(&lv)?; [INFO] [stdout] | ^^^ help: change this to: `lv` [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] --> ir/src/ast_to_hir.rs:488:66 [INFO] [stdout] | [INFO] [stdout] 488 | let (mut stmts, value) = self.emit_value(&expr)?; [INFO] [stdout] | ^^^^^ help: change this to: `expr` [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] --> ir/src/ast_to_hir.rs:499:37 [INFO] [stdout] | [INFO] [stdout] 499 | self.emit_block(&then, false)?, [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:500:42 [INFO] [stdout] | [INFO] [stdout] 500 | self.emit_else_block(&else_)? [INFO] [stdout] | ^^^^^^ help: change this to: `else_` [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] --> ir/src/ast_to_hir.rs:535:63 [INFO] [stdout] | [INFO] [stdout] 535 | body_block = body_block.merge(self.emit_block(&body, false)?); [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:546:62 [INFO] [stdout] | [INFO] [stdout] 546 | let (stmts_cond, val_cond) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:547:54 [INFO] [stdout] | [INFO] [stdout] 547 | let mut while_body = self.emit_block(&body, false)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:557:58 [INFO] [stdout] | [INFO] [stdout] 557 | let (mut stmts, vals) = self.emit_values(&args)?; [INFO] [stdout] | ^^^^^ help: change this to: `args` [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] --> ir/src/ast_to_hir.rs:563:66 [INFO] [stdout] | [INFO] [stdout] 563 | stmts.extend(self.unpack_variadic_call(&tmp, &f_name, false, &vals)?); [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:567:80 [INFO] [stdout] | [INFO] [stdout] 567 | hir::Callable::Call(f_name.clone(), is_native_function(&f_name), vals), [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:575:63 [INFO] [stdout] | [INFO] [stdout] 575 | None => self.emit_global_assign(&lv.name, &e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> ir/src/ast_to_hir.rs:576:79 [INFO] [stdout] | [INFO] [stdout] 576 | Some(p_exp) => self.emit_composed_assign(p_exp, &lv.name, &e) [INFO] [stdout] | ^^ help: change this to: `e` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:616:73 [INFO] [stdout] | [INFO] [stdout] 616 | fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &String, rhs_expr: &Exp) -> HIRStatementsResult { [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] 616 ~ fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &str, rhs_expr: &Exp) -> HIRStatementsResult { [INFO] [stdout] 617 | let (mut stmts, struct_val) = self.emit_value(structure_exp)?; [INFO] [stdout] ... [INFO] [stdout] 635 | hir::Statement::Call( [INFO] [stdout] 636 ~ hir::LValue::Access(struct_val, struct_name.clone(), field_name.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:661:50 [INFO] [stdout] | [INFO] [stdout] 661 | exps.iter().map(|e| self.emit_statements(&e)).flat_map(|result| match result { [INFO] [stdout] | ^^ help: change this to: `e` [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: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:662:48 [INFO] [stdout] | [INFO] [stdout] 662 | Ok(stmts) => stmts.into_iter().map(|item| Ok(item)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> ir/src/ast_to_hir.rs:676:13 [INFO] [stdout] | [INFO] [stdout] 676 | / self.emit_flattened_statements(&b.val) [INFO] [stdout] 677 | | .and_then(|stmts| Ok(hir::Block::new(stmts))) [INFO] [stdout] | |_________________________________________________________^ help: try: `self.emit_flattened_statements(&b.val).map(|stmts| hir::Block::new(stmts))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:684:53 [INFO] [stdout] | [INFO] [stdout] 684 | ElseVal::Else(block) => self.emit_block(&block, false), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:686:61 [INFO] [stdout] | [INFO] [stdout] 686 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:689:66 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:689:103 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^^^ help: change this to: `else__` [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] --> ir/src/ast_to_hir.rs:700:59 [INFO] [stdout] | [INFO] [stdout] 700 | ElseVal::Else(block) => self.emit_block_value(&block), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:703:61 [INFO] [stdout] | [INFO] [stdout] 703 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:813:62 [INFO] [stdout] | [INFO] [stdout] 813 | weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [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] 813 - weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] 813 + weights[index] = f.params.iter().map(|param| if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> ir/src/ast_to_hir.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | (0..variants).into_iter().map(|i| format!("{}_{}", name, i)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..variants)` [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(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:131:14 [INFO] [stdout] | [INFO] [stdout] 131 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 132 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 206 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/hir_to_lir.rs:542:40 [INFO] [stdout] | [INFO] [stdout] 542 | let mut local = LocalRegistry::new(&global, &vars_and_params); [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/hir_to_lir.rs:554:54 [INFO] [stdout] | [INFO] [stdout] 554 | let mut statements = compile_block(&mut lbl_gen, &global, &mut local, &f.body)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/lir_to_asm.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | f.body.stmts.iter().for_each(|stmt| match stmt { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 63 | | Statement::Label(label) => { [INFO] [stdout] 64 | | recv.recv_label(&label.name) [INFO] [stdout] 65 | | }, [INFO] [stdout] 66 | | _ => () [INFO] [stdout] 67 | | }); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 ~ f.body.stmts.iter().for_each(|stmt| if let Statement::Label(label) = stmt { [INFO] [stdout] 63 + recv.recv_label(&label.name) [INFO] [stdout] 64 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:273:44 [INFO] [stdout] | [INFO] [stdout] 273 | .chain(args.iter().map(|a| UsrOrNative::Usr(a))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:276:33 [INFO] [stdout] | [INFO] [stdout] 276 | args.iter().map(|a| UsrOrNative::Usr(a)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:280:24 [INFO] [stdout] | [INFO] [stdout] 280 | if (args.len() - 6) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(args.len() - 6).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:388:29 [INFO] [stdout] | [INFO] [stdout] 388 | let frame_size = 8 * if var_count % 2 == 0 {var_count} else {var_count + 1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `var_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:124:21 [INFO] [stdout] | [INFO] [stdout] 124 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:157:21 [INFO] [stdout] | [INFO] [stdout] 157 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", arg) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:218:21 [INFO] [stdout] | [INFO] [stdout] 218 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stderr] Checking compiler v0.1.0 (/opt/rustwide/workdir/compiler) [INFO] [stdout] warning: unused import: `std::fs::read_dir` [INFO] [stdout] --> compiler/src/main.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fs::read_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `parser::parse_and_type_file` [INFO] [stdout] --> compiler/src/main.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use parser::parse_and_type_file; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::read_dir` [INFO] [stdout] --> compiler/src/main.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fs::read_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `parser::parse_and_type_file` [INFO] [stdout] --> compiler/src/main.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use parser::parse_and_type_file; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> compiler/src/main.rs:21:37 [INFO] [stdout] | [INFO] [stdout] 21 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> compiler/src/main.rs:38:39 [INFO] [stdout] | [INFO] [stdout] 38 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> compiler/src/main.rs:90:1 [INFO] [stdout] | [INFO] [stdout] 90 | / fn compile(input: &str, [INFO] [stdout] 91 | | output: &str, [INFO] [stdout] 92 | | parse_only: bool, [INFO] [stdout] 93 | | type_only: bool, [INFO] [stdout] 94 | | asm_only: bool, [INFO] [stdout] 95 | | debug_hir: bool, debug_lir: bool, [INFO] [stdout] 96 | | runtime_object_filename: &str) -> Result<(), String> { [INFO] [stdout] | |________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> compiler/src/main.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | &s[..s.len() - p.len()] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> compiler/src/main.rs:145:5 [INFO] [stdout] | [INFO] [stdout] 145 | if s.ends_with(p) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_suffix` method [INFO] [stdout] | [INFO] [stdout] 145 ~ if let Some() = s.strip_suffix(p) { [INFO] [stdout] 146 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> compiler/src/main.rs:21:37 [INFO] [stdout] | [INFO] [stdout] 21 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> compiler/src/main.rs:38:39 [INFO] [stdout] | [INFO] [stdout] 38 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> compiler/src/main.rs:90:1 [INFO] [stdout] | [INFO] [stdout] 90 | / fn compile(input: &str, [INFO] [stdout] 91 | | output: &str, [INFO] [stdout] 92 | | parse_only: bool, [INFO] [stdout] 93 | | type_only: bool, [INFO] [stdout] 94 | | asm_only: bool, [INFO] [stdout] 95 | | debug_hir: bool, debug_lir: bool, [INFO] [stdout] 96 | | runtime_object_filename: &str) -> Result<(), String> { [INFO] [stdout] | |________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> compiler/src/main.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | &s[..s.len() - p.len()] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> compiler/src/main.rs:145:5 [INFO] [stdout] | [INFO] [stdout] 145 | if s.ends_with(p) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_suffix` method [INFO] [stdout] | [INFO] [stdout] 145 ~ if let Some() = s.strip_suffix(p) { [INFO] [stdout] 146 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> ir/src/ast_to_hir.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> ir/src/ast_to_hir.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `reset` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 27 | impl Renamer { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 54 | fn reset(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `emit_unique_gvar_name` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:214:8 [INFO] [stdout] | [INFO] [stdout] 87 | impl Emitter { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 214 | fn emit_unique_gvar_name(&mut self, gvar: &String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", arg) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.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: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:218:21 [INFO] [stdout] | [INFO] [stdout] 218 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:124:21 [INFO] [stdout] | [INFO] [stdout] 124 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:157:21 [INFO] [stdout] | [INFO] [stdout] 157 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: method `reset` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 27 | impl Renamer { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 54 | fn reset(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `emit_unique_gvar_name` is never used [INFO] [stdout] --> ir/src/ast_to_hir.rs:214:8 [INFO] [stdout] | [INFO] [stdout] 87 | impl Emitter { [INFO] [stdout] | ------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 214 | fn emit_unique_gvar_name(&mut self, gvar: &String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> ir/src/ast_to_hir.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / match n { [INFO] [stdout] 72 | | "pow" => true, [INFO] [stdout] 73 | | _ => false [INFO] [stdout] 74 | | } [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] 71 - match n { [INFO] [stdout] 72 - "pow" => true, [INFO] [stdout] 73 - _ => false [INFO] [stdout] 74 - } [INFO] [stdout] 71 + matches!(n, "pow") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | fn emit_panic_call(&mut self, out: &String, message: &str) -> HIRStatementsResult { [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] 100 ~ fn emit_panic_call(&mut self, out: &str, message: &str) -> HIRStatementsResult { [INFO] [stdout] 101 ~ Ok(vec![hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> ir/src/ast_to_hir.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 152 - body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [INFO] [stdout] 152 + body = body.merge(variants.into_iter().zip(cond_vars).fold( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:45 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &str, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 178 | stmts.push( [INFO] [stdout] 179 ~ hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:64 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &String, fun_name: &str, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 179 | hir::Statement::Call(self.renamer.get_lvalue(out.clone()), [INFO] [stdout] 180 ~ hir::Callable::Call(fun_name.to_owned(), native, vec![arg.clone()])) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:189:51 [INFO] [stdout] | [INFO] [stdout] 189 | let mut stmts = self.unpack_variadic_call(&tmp, &"print".to_string(), false, args)?; [INFO] [stdout] | ^^^^ help: change this to: `tmp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:200:89 [INFO] [stdout] | [INFO] [stdout] 200 | Ok(vec![self.emit_print_function()?, self.emit_div_function()?].into_iter().map(|fun| hir::Decl::Function(fun)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `hir::Decl::Function` [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: useless use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | format!("{}", arg) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.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] --> ir/src/ast_to_hir.rs:246:67 [INFO] [stdout] | [INFO] [stdout] 246 | let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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 use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:331:75 [INFO] [stdout] | [INFO] [stdout] 331 | ... let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:372:56 [INFO] [stdout] | [INFO] [stdout] 372 | let (mut stmts, val) = self.emit_value(&exp)?; [INFO] [stdout] | ^^^^ help: change this to: `exp` [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] --> ir/src/ast_to_hir.rs:415:70 [INFO] [stdout] | [INFO] [stdout] 415 | stmts.extend(self.unpack_variadic_call(&out, &name, false, &vals)?); [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] --> ir/src/ast_to_hir.rs:419:82 [INFO] [stdout] | [INFO] [stdout] 419 | ... hir::Callable::Call(name.clone(), is_native_function(&name), vals)) [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] --> ir/src/ast_to_hir.rs:465:65 [INFO] [stdout] | [INFO] [stdout] 465 | let (stmts_lv, val_lv) = self.emit_lvalue_value(&lv)?; [INFO] [stdout] | ^^^ help: change this to: `lv` [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 use of `format!` [INFO] [stdout] --> ir/src/hir/printing.rs:218:21 [INFO] [stdout] | [INFO] [stdout] 218 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:488:66 [INFO] [stdout] | [INFO] [stdout] 488 | let (mut stmts, value) = self.emit_value(&expr)?; [INFO] [stdout] | ^^^^^ help: change this to: `expr` [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] --> ir/src/ast_to_hir.rs:499:37 [INFO] [stdout] | [INFO] [stdout] 499 | self.emit_block(&then, false)?, [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:500:42 [INFO] [stdout] | [INFO] [stdout] 500 | self.emit_else_block(&else_)? [INFO] [stdout] | ^^^^^^ help: change this to: `else_` [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] --> ir/src/ast_to_hir.rs:535:63 [INFO] [stdout] | [INFO] [stdout] 535 | body_block = body_block.merge(self.emit_block(&body, false)?); [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:546:62 [INFO] [stdout] | [INFO] [stdout] 546 | let (stmts_cond, val_cond) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:547:54 [INFO] [stdout] | [INFO] [stdout] 547 | let mut while_body = self.emit_block(&body, false)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:557:58 [INFO] [stdout] | [INFO] [stdout] 557 | let (mut stmts, vals) = self.emit_values(&args)?; [INFO] [stdout] | ^^^^^ help: change this to: `args` [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] --> ir/src/ast_to_hir.rs:563:66 [INFO] [stdout] | [INFO] [stdout] 563 | stmts.extend(self.unpack_variadic_call(&tmp, &f_name, false, &vals)?); [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:567:80 [INFO] [stdout] | [INFO] [stdout] 567 | hir::Callable::Call(f_name.clone(), is_native_function(&f_name), vals), [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:575:63 [INFO] [stdout] | [INFO] [stdout] 575 | None => self.emit_global_assign(&lv.name, &e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> ir/src/ast_to_hir.rs:576:79 [INFO] [stdout] | [INFO] [stdout] 576 | Some(p_exp) => self.emit_composed_assign(p_exp, &lv.name, &e) [INFO] [stdout] | ^^ help: change this to: `e` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:616:73 [INFO] [stdout] | [INFO] [stdout] 616 | fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &String, rhs_expr: &Exp) -> HIRStatementsResult { [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] 616 ~ fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &str, rhs_expr: &Exp) -> HIRStatementsResult { [INFO] [stdout] 617 | let (mut stmts, struct_val) = self.emit_value(structure_exp)?; [INFO] [stdout] ... [INFO] [stdout] 635 | hir::Statement::Call( [INFO] [stdout] 636 ~ hir::LValue::Access(struct_val, struct_name.clone(), field_name.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:661:50 [INFO] [stdout] | [INFO] [stdout] 661 | exps.iter().map(|e| self.emit_statements(&e)).flat_map(|result| match result { [INFO] [stdout] | ^^ help: change this to: `e` [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: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:662:48 [INFO] [stdout] | [INFO] [stdout] 662 | Ok(stmts) => stmts.into_iter().map(|item| Ok(item)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> ir/src/ast_to_hir.rs:676:13 [INFO] [stdout] | [INFO] [stdout] 676 | / self.emit_flattened_statements(&b.val) [INFO] [stdout] 677 | | .and_then(|stmts| Ok(hir::Block::new(stmts))) [INFO] [stdout] | |_________________________________________________________^ help: try: `self.emit_flattened_statements(&b.val).map(|stmts| hir::Block::new(stmts))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:684:53 [INFO] [stdout] | [INFO] [stdout] 684 | ElseVal::Else(block) => self.emit_block(&block, false), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:686:61 [INFO] [stdout] | [INFO] [stdout] 686 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:689:66 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:689:103 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^^^ help: change this to: `else__` [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] --> ir/src/ast_to_hir.rs:700:59 [INFO] [stdout] | [INFO] [stdout] 700 | ElseVal::Else(block) => self.emit_block_value(&block), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:703:61 [INFO] [stdout] | [INFO] [stdout] 703 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:813:62 [INFO] [stdout] | [INFO] [stdout] 813 | weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [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] 813 - weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] 813 + weights[index] = f.params.iter().map(|param| if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> ir/src/ast_to_hir.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | (0..variants).into_iter().map(|i| format!("{}_{}", name, i)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..variants)` [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(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:131:14 [INFO] [stdout] | [INFO] [stdout] 131 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 132 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 206 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/hir_to_lir.rs:542:40 [INFO] [stdout] | [INFO] [stdout] 542 | let mut local = LocalRegistry::new(&global, &vars_and_params); [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/hir_to_lir.rs:554:54 [INFO] [stdout] | [INFO] [stdout] 554 | let mut statements = compile_block(&mut lbl_gen, &global, &mut local, &f.body)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/lir_to_asm.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | f.body.stmts.iter().for_each(|stmt| match stmt { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 63 | | Statement::Label(label) => { [INFO] [stdout] 64 | | recv.recv_label(&label.name) [INFO] [stdout] 65 | | }, [INFO] [stdout] 66 | | _ => () [INFO] [stdout] 67 | | }); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 ~ f.body.stmts.iter().for_each(|stmt| if let Statement::Label(label) = stmt { [INFO] [stdout] 63 + recv.recv_label(&label.name) [INFO] [stdout] 64 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:273:44 [INFO] [stdout] | [INFO] [stdout] 273 | .chain(args.iter().map(|a| UsrOrNative::Usr(a))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:276:33 [INFO] [stdout] | [INFO] [stdout] 276 | args.iter().map(|a| UsrOrNative::Usr(a)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:280:24 [INFO] [stdout] | [INFO] [stdout] 280 | if (args.len() - 6) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(args.len() - 6).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:388:29 [INFO] [stdout] | [INFO] [stdout] 388 | let frame_size = 8 * if var_count % 2 == 0 {var_count} else {var_count + 1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `var_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> ir/src/main.rs:27:37 [INFO] [stdout] | [INFO] [stdout] 27 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> ir/src/main.rs:42:39 [INFO] [stdout] | [INFO] [stdout] 42 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:124:21 [INFO] [stdout] | [INFO] [stdout] 124 | format!("{}", var) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `var.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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> ir/src/lir/printing.rs:157:21 [INFO] [stdout] | [INFO] [stdout] 157 | format!("{}", v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `v.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] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> ir/src/ast_to_hir.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / match n { [INFO] [stdout] 72 | | "pow" => true, [INFO] [stdout] 73 | | _ => false [INFO] [stdout] 74 | | } [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] 71 - match n { [INFO] [stdout] 72 - "pow" => true, [INFO] [stdout] 73 - _ => false [INFO] [stdout] 74 - } [INFO] [stdout] 71 + matches!(n, "pow") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | fn emit_panic_call(&mut self, out: &String, message: &str) -> HIRStatementsResult { [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] 100 ~ fn emit_panic_call(&mut self, out: &str, message: &str) -> HIRStatementsResult { [INFO] [stdout] 101 ~ Ok(vec![hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> ir/src/ast_to_hir.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 152 - body = body.merge(variants.into_iter().zip(cond_vars.into_iter()).fold( [INFO] [stdout] 152 + body = body.merge(variants.into_iter().zip(cond_vars).fold( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:45 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &str, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 178 | stmts.push( [INFO] [stdout] 179 ~ hir::Statement::Call(self.renamer.get_lvalue(out.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:173:64 [INFO] [stdout] | [INFO] [stdout] 173 | fn unpack_variadic_call(&mut self, out: &String, fun_name: &String, native: bool, args: &Vec) -> HIRStatementsResult { [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] 173 ~ fn unpack_variadic_call(&mut self, out: &String, fun_name: &str, native: bool, args: &Vec) -> HIRStatementsResult { [INFO] [stdout] 174 | // f(…a)= := f(a_1); …; f(a_n) [INFO] [stdout] ... [INFO] [stdout] 179 | hir::Statement::Call(self.renamer.get_lvalue(out.clone()), [INFO] [stdout] 180 ~ hir::Callable::Call(fun_name.to_owned(), native, vec![arg.clone()])) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:189:51 [INFO] [stdout] | [INFO] [stdout] 189 | let mut stmts = self.unpack_variadic_call(&tmp, &"print".to_string(), false, args)?; [INFO] [stdout] | ^^^^ help: change this to: `tmp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:200:89 [INFO] [stdout] | [INFO] [stdout] 200 | Ok(vec![self.emit_print_function()?, self.emit_div_function()?].into_iter().map(|fun| hir::Decl::Function(fun)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `hir::Decl::Function` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:246:67 [INFO] [stdout] | [INFO] [stdout] 246 | let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:331:75 [INFO] [stdout] | [INFO] [stdout] 331 | ... let (mut stmts, st_val) = self.emit_value(&p_exp)?; [INFO] [stdout] | ^^^^^^ help: change this to: `p_exp` [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] --> ir/src/ast_to_hir.rs:372:56 [INFO] [stdout] | [INFO] [stdout] 372 | let (mut stmts, val) = self.emit_value(&exp)?; [INFO] [stdout] | ^^^^ help: change this to: `exp` [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] --> ir/src/ast_to_hir.rs:415:70 [INFO] [stdout] | [INFO] [stdout] 415 | stmts.extend(self.unpack_variadic_call(&out, &name, false, &vals)?); [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] --> ir/src/ast_to_hir.rs:419:82 [INFO] [stdout] | [INFO] [stdout] 419 | ... hir::Callable::Call(name.clone(), is_native_function(&name), vals)) [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] --> ir/src/ast_to_hir.rs:465:65 [INFO] [stdout] | [INFO] [stdout] 465 | let (stmts_lv, val_lv) = self.emit_lvalue_value(&lv)?; [INFO] [stdout] | ^^^ help: change this to: `lv` [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] --> ir/src/ast_to_hir.rs:488:66 [INFO] [stdout] | [INFO] [stdout] 488 | let (mut stmts, value) = self.emit_value(&expr)?; [INFO] [stdout] | ^^^^^ help: change this to: `expr` [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] --> ir/src/ast_to_hir.rs:499:37 [INFO] [stdout] | [INFO] [stdout] 499 | self.emit_block(&then, false)?, [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:500:42 [INFO] [stdout] | [INFO] [stdout] 500 | self.emit_else_block(&else_)? [INFO] [stdout] | ^^^^^^ help: change this to: `else_` [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] --> ir/src/ast_to_hir.rs:535:63 [INFO] [stdout] | [INFO] [stdout] 535 | body_block = body_block.merge(self.emit_block(&body, false)?); [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:546:62 [INFO] [stdout] | [INFO] [stdout] 546 | let (stmts_cond, val_cond) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:547:54 [INFO] [stdout] | [INFO] [stdout] 547 | let mut while_body = self.emit_block(&body, false)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [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] --> ir/src/ast_to_hir.rs:557:58 [INFO] [stdout] | [INFO] [stdout] 557 | let (mut stmts, vals) = self.emit_values(&args)?; [INFO] [stdout] | ^^^^^ help: change this to: `args` [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] --> ir/src/ast_to_hir.rs:563:66 [INFO] [stdout] | [INFO] [stdout] 563 | stmts.extend(self.unpack_variadic_call(&tmp, &f_name, false, &vals)?); [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:567:80 [INFO] [stdout] | [INFO] [stdout] 567 | hir::Callable::Call(f_name.clone(), is_native_function(&f_name), vals), [INFO] [stdout] | ^^^^^^^ help: change this to: `f_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] --> ir/src/ast_to_hir.rs:575:63 [INFO] [stdout] | [INFO] [stdout] 575 | None => self.emit_global_assign(&lv.name, &e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> ir/src/ast_to_hir.rs:576:79 [INFO] [stdout] | [INFO] [stdout] 576 | Some(p_exp) => self.emit_composed_assign(p_exp, &lv.name, &e) [INFO] [stdout] | ^^ help: change this to: `e` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> ir/src/ast_to_hir.rs:616:73 [INFO] [stdout] | [INFO] [stdout] 616 | fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &String, rhs_expr: &Exp) -> HIRStatementsResult { [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] 616 ~ fn emit_composed_assign(&mut self, structure_exp: &Exp, field_name: &str, rhs_expr: &Exp) -> HIRStatementsResult { [INFO] [stdout] 617 | let (mut stmts, struct_val) = self.emit_value(structure_exp)?; [INFO] [stdout] ... [INFO] [stdout] 635 | hir::Statement::Call( [INFO] [stdout] 636 ~ hir::LValue::Access(struct_val, struct_name.clone(), field_name.to_owned()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:661:50 [INFO] [stdout] | [INFO] [stdout] 661 | exps.iter().map(|e| self.emit_statements(&e)).flat_map(|result| match result { [INFO] [stdout] | ^^ help: change this to: `e` [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: redundant closure [INFO] [stdout] --> ir/src/ast_to_hir.rs:662:48 [INFO] [stdout] | [INFO] [stdout] 662 | Ok(stmts) => stmts.into_iter().map(|item| Ok(item)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> ir/src/ast_to_hir.rs:676:13 [INFO] [stdout] | [INFO] [stdout] 676 | / self.emit_flattened_statements(&b.val) [INFO] [stdout] 677 | | .and_then(|stmts| Ok(hir::Block::new(stmts))) [INFO] [stdout] | |_________________________________________________________^ help: try: `self.emit_flattened_statements(&b.val).map(|stmts| hir::Block::new(stmts))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/ast_to_hir.rs:684:53 [INFO] [stdout] | [INFO] [stdout] 684 | ElseVal::Else(block) => self.emit_block(&block, false), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:686:61 [INFO] [stdout] | [INFO] [stdout] 686 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:689:66 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^ help: change this to: `then` [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] --> ir/src/ast_to_hir.rs:689:103 [INFO] [stdout] | [INFO] [stdout] 689 | hir::Statement::If(cond_val, self.emit_block(&then, false)?, self.emit_else_block(&else__)?) [INFO] [stdout] | ^^^^^^^ help: change this to: `else__` [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] --> ir/src/ast_to_hir.rs:700:59 [INFO] [stdout] | [INFO] [stdout] 700 | ElseVal::Else(block) => self.emit_block_value(&block), [INFO] [stdout] | ^^^^^^ help: change this to: `block` [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] --> ir/src/ast_to_hir.rs:703:61 [INFO] [stdout] | [INFO] [stdout] 703 | let (mut stmts, cond_val) = self.emit_value(&cond)?; [INFO] [stdout] | ^^^^^ help: change this to: `cond` [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] --> ir/src/ast_to_hir.rs:813:62 [INFO] [stdout] | [INFO] [stdout] 813 | weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [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] 813 - weights[index] = f.params.iter().map(|param| return if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] 813 + weights[index] = f.params.iter().map(|param| if param.ty != StaticType::Any { 1 } else { 0 }).sum(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> ir/src/ast_to_hir.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | (0..variants).into_iter().map(|i| format!("{}_{}", name, i)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..variants)` [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(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:131:14 [INFO] [stdout] | [INFO] [stdout] 131 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 132 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> ir/src/hir_to_lir.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | .map(|data| vec!(data.ty_name.clone(), data.val_name.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 206 | | .flatten().collect() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| vec!(data.ty_name.clone(), data.val_name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> ir/src/hir_to_lir.rs:542:40 [INFO] [stdout] | [INFO] [stdout] 542 | let mut local = LocalRegistry::new(&global, &vars_and_params); [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/hir_to_lir.rs:554:54 [INFO] [stdout] | [INFO] [stdout] 554 | let mut statements = compile_block(&mut lbl_gen, &global, &mut local, &f.body)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `global` [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] --> ir/src/lir_to_asm.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | f.body.stmts.iter().for_each(|stmt| match stmt { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 63 | | Statement::Label(label) => { [INFO] [stdout] 64 | | recv.recv_label(&label.name) [INFO] [stdout] 65 | | }, [INFO] [stdout] 66 | | _ => () [INFO] [stdout] 67 | | }); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 ~ f.body.stmts.iter().for_each(|stmt| if let Statement::Label(label) = stmt { [INFO] [stdout] 63 + recv.recv_label(&label.name) [INFO] [stdout] 64 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:273:44 [INFO] [stdout] | [INFO] [stdout] 273 | .chain(args.iter().map(|a| UsrOrNative::Usr(a))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: redundant closure [INFO] [stdout] --> ir/src/lir_to_asm.rs:276:33 [INFO] [stdout] | [INFO] [stdout] 276 | args.iter().map(|a| UsrOrNative::Usr(a)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `UsrOrNative::Usr` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:280:24 [INFO] [stdout] | [INFO] [stdout] 280 | if (args.len() - 6) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(args.len() - 6).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> ir/src/lir_to_asm.rs:388:29 [INFO] [stdout] | [INFO] [stdout] 388 | let frame_size = 8 * if var_count % 2 == 0 {var_count} else {var_count + 1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `var_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> ir/src/main.rs:27:37 [INFO] [stdout] | [INFO] [stdout] 27 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> ir/src/main.rs:42:39 [INFO] [stdout] | [INFO] [stdout] 42 | let mut file = match File::create(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub struct LocatedIdent<'a> { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] 6 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LocatedIdent` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 113 | pub struct Range<'a> { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 114 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Range` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 133 | pub struct Else<'a> { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 134 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Else` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | Int(i64), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 151 - Int(i64), [INFO] [stdout] 151 + Int(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | Str(String), [INFO] [stdout] | --- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 152 - Str(String), [INFO] [stdout] 152 + Str(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:153:10 [INFO] [stdout] | [INFO] [stdout] 153 | Bool(bool), [INFO] [stdout] | ---- ^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 153 - Bool(bool), [INFO] [stdout] 153 + Bool(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | Mul(i64, String), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 158 - Mul(i64, String), [INFO] [stdout] 158 + Mul((), String), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:159:10 [INFO] [stdout] | [INFO] [stdout] 159 | LMul(i64, Block<'a>), [INFO] [stdout] | ---- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 159 - LMul(i64, Block<'a>), [INFO] [stdout] 159 + LMul((), Block<'a>), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 219 | pub struct Block<'a> { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 220 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Block` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 275 | pub struct Decl<'a> { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 276 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Decl` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `functions`, `structures`, and `global_expressions` are never read [INFO] [stdout] --> parser/src/typing/data.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct TypedDecls<'a> { [INFO] [stdout] | ---------- fields in this struct [INFO] [stdout] 26 | pub functions: HashMap>>, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 27 | pub structures: HashMap>, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 28 | pub global_expressions: Vec> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TypedDecls` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `local` is never used [INFO] [stdout] --> parser/src/typing/data.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 66 | impl EnvVariable { [INFO] [stdout] | ---------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn local() -> Self { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `known_types` is never read [INFO] [stdout] --> parser/src/typing/data.rs:84:9 [INFO] [stdout] | [INFO] [stdout] 81 | pub struct TypingContext<'a> { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 84 | pub known_types: HashSet, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TypingContext` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_alive_in_env` is never used [INFO] [stdout] --> parser/src/typing/data.rs:176:12 [INFO] [stdout] | [INFO] [stdout] 93 | impl<'a> TypingContext<'a> { [INFO] [stdout] | -------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 176 | pub fn is_alive_in_env(&self, ident: &LocatedIdent<'a>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub struct LocatedIdent<'a> { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] 6 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LocatedIdent` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 113 | pub struct Range<'a> { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 114 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Range` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 133 | pub struct Else<'a> { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 134 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Else` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | Int(i64), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 151 - Int(i64), [INFO] [stdout] 151 + Int(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | Str(String), [INFO] [stdout] | --- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 152 - Str(String), [INFO] [stdout] 152 + Str(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:153:10 [INFO] [stdout] | [INFO] [stdout] 153 | Bool(bool), [INFO] [stdout] | ---- ^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 153 - Bool(bool), [INFO] [stdout] 153 + Bool(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | Mul(i64, String), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 158 - Mul(i64, String), [INFO] [stdout] 158 + Mul((), String), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> parser/src/ast.rs:159:10 [INFO] [stdout] | [INFO] [stdout] 159 | LMul(i64, Block<'a>), [INFO] [stdout] | ---- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExpVal` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 159 - LMul(i64, Block<'a>), [INFO] [stdout] 159 + LMul((), Block<'a>), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 219 | pub struct Block<'a> { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 220 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Block` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `span` is never read [INFO] [stdout] --> parser/src/ast.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 275 | pub struct Decl<'a> { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 276 | pub span: Span<'a>, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Decl` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `functions`, `structures`, and `global_expressions` are never read [INFO] [stdout] --> parser/src/typing/data.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct TypedDecls<'a> { [INFO] [stdout] | ---------- fields in this struct [INFO] [stdout] 26 | pub functions: HashMap>>, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 27 | pub structures: HashMap>, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 28 | pub global_expressions: Vec> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TypedDecls` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `local` is never used [INFO] [stdout] --> parser/src/typing/data.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 66 | impl EnvVariable { [INFO] [stdout] | ---------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn local() -> Self { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `known_types` is never read [INFO] [stdout] --> parser/src/typing/data.rs:84:9 [INFO] [stdout] | [INFO] [stdout] 81 | pub struct TypingContext<'a> { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 84 | pub known_types: HashSet, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TypingContext` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_alive_in_env` is never used [INFO] [stdout] --> parser/src/typing/data.rs:176:12 [INFO] [stdout] | [INFO] [stdout] 93 | impl<'a> TypingContext<'a> { [INFO] [stdout] | -------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 176 | pub fn is_alive_in_env(&self, ident: &LocatedIdent<'a>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parser/src/parse.rs:824:5 [INFO] [stdout] | [INFO] [stdout] 824 | Ok(ast?) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 824 - Ok(ast?) [INFO] [stdout] 824 + ast [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> parser/src/parse.rs:824:5 [INFO] [stdout] | [INFO] [stdout] 824 | Ok(ast?) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 824 - Ok(ast?) [INFO] [stdout] 824 + ast [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> parser/src/typing/main.rs:11:11 [INFO] [stdout] | [INFO] [stdout] 11 | known.into_iter().map(|t| (t.clone(), vec![EnvVariable::init()])).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] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/main.rs:64:36 [INFO] [stdout] | [INFO] [stdout] 64 | verify_implicit_return(&func)?; [INFO] [stdout] | ^^^^^ help: change this to: `func` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/data.rs:17:34 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn is_builtin_function(name: &String) -> bool { [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] 17 ~ pub fn is_builtin_function(name: &str) -> bool { [INFO] [stdout] 18 ~ match name { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/data.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / match name.as_str() { [INFO] [stdout] 19 | | "println" | "div" | "print" => true, [INFO] [stdout] 20 | | _ => false [INFO] [stdout] 21 | | } [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] 18 - match name.as_str() { [INFO] [stdout] 19 - "println" | "div" | "print" => true, [INFO] [stdout] 20 - _ => false [INFO] [stdout] 21 - } [INFO] [stdout] 18 + matches!(name.as_str(), "println" | "div" | "print") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:129:26 [INFO] [stdout] | [INFO] [stdout] 129 | self.push_to_env(&ident, StaticType::Any, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/data.rs:133:61 [INFO] [stdout] | [INFO] [stdout] 133 | idents.iter().for_each(|var| self.push_local_to_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [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] --> parser/src/typing/data.rs:145:20 [INFO] [stdout] | [INFO] [stdout] 145 | if types.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `types.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:153:56 [INFO] [stdout] | [INFO] [stdout] 153 | idents.iter().for_each(|var| self.pop_from_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:159:27 [INFO] [stdout] | [INFO] [stdout] 159 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 160 | | None => None, [INFO] [stdout] 161 | | Some(var) => Some(var.ty.clone()) [INFO] [stdout] 162 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.ty.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 170 | | None => None, [INFO] [stdout] 171 | | Some(var) => Some(var.scope) [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.scope)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&ident.name).is_some()` [INFO] [stdout] --> parser/src/typing/data.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | self.environment.get(&ident.name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&ident.name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:14:64 [INFO] [stdout] | [INFO] [stdout] 14 | ElseVal::ElseIf(e, b, rest_) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | .chain(collect_all_assign_in_array(&b.val).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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 16 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:17:24 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).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] 17 - .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] 17 + .chain(collect_else(&rest_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:17:37 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/assign.rs:26:43 [INFO] [stdout] | [INFO] [stdout] 26 | Some(e) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut assigns = collect_all_assign(&e); [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / match lv.in_exp { [INFO] [stdout] 31 | | None => assigns.push(LocatedIdent::new( [INFO] [stdout] 32 | | lv.span, [INFO] [stdout] 33 | | lv.name.clone())), [INFO] [stdout] 34 | | _ => {} [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 ~ if let None = lv.in_exp { assigns.push(LocatedIdent::new( [INFO] [stdout] 31 + lv.span, [INFO] [stdout] 32 ~ lv.name.clone())) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:38:61 [INFO] [stdout] | [INFO] [stdout] 38 | ExpVal::BinOp(_, alpha, beta) => collect_all_assign(&alpha) [INFO] [stdout] | ^^^^^^ help: change this to: `alpha` [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] --> parser/src/typing/assign.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).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] 40 - .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] 40 + .chain(collect_all_assign(&beta)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] | ^^^^^ help: change this to: `beta` [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] --> parser/src/typing/assign.rs:42:53 [INFO] [stdout] | [INFO] [stdout] 42 | ExpVal::UnaryOp(_, e) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:43:61 [INFO] [stdout] | [INFO] [stdout] 43 | ExpVal::Call(_, e_s) => collect_all_assign_in_array(&e_s), [INFO] [stdout] | ^^^^ help: change this to: `e_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] --> parser/src/typing/assign.rs:45:50 [INFO] [stdout] | [INFO] [stdout] 45 | ExpVal::RMul(e, _) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:46:61 [INFO] [stdout] | [INFO] [stdout] 46 | ExpVal::If(e, b, else_branch) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | .chain(collect_all_assign_in_array(&b.val).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] 48 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 48 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).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] 49 - .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] 49 + .chain(collect_else(&else_branch)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:49:33 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `else_branch` [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] --> parser/src/typing/returns.rs:41:36 [INFO] [stdout] | [INFO] [stdout] 41 | visit_else_returns(&rest_, expected)?; [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/returns.rs:52:27 [INFO] [stdout] | [INFO] [stdout] 52 | visit_returns(&a, expected)?; [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/returns.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | visit_returns(&b, expected)?; [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/phase1.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | fn is_reserved_name(n: &String) -> bool { [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] 8 ~ fn is_reserved_name(n: &str) -> bool { [INFO] [stdout] 9 ~ match n { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/phase1.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / match n.as_str() { [INFO] [stdout] 10 | | "div" | "print" | "println" => true, [INFO] [stdout] 11 | | _ => false [INFO] [stdout] 12 | | } [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] 9 - match n.as_str() { [INFO] [stdout] 10 - "div" | "print" | "println" => true, [INFO] [stdout] 11 - _ => false [INFO] [stdout] 12 - } [INFO] [stdout] 9 + matches!(n.as_str(), "div" | "print" | "println") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:37:34 [INFO] [stdout] | [INFO] [stdout] 37 | ...n, format!("This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before").to... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before".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: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | ...aram.span, format!("This type is malformed, either it is not a primitive or it's not a declared before structure").to_string()).i... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive or it's not a declared before structure".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/phase1.rs:97:94 [INFO] [stdout] | [INFO] [stdout] 97 | if is_callable_with_exactly(f.params.iter().map(|arg| arg.ty.clone()).collect(), &sig) { [INFO] [stdout] | ^^^^ help: change this to: `sig` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:14:65 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [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] 14 - pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [INFO] [stdout] 14 + pub fn is_this_call_ambiguous(args: Vec, functions: &[FuncSignature]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:50 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:47:70 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [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] 47 - pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [INFO] [stdout] 47 + pub fn compute_ambiguous_signature(args: Vec, functions: &[FuncSignature]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:67 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:100 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:75:43 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [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] 75 - pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [INFO] [stdout] 75 + pub fn compute_selectivity_weight(params: &[StaticType], target_sig: &FuncSignature) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:87:10 [INFO] [stdout] | [INFO] [stdout] 87 | .into_iter() [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: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [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] 10 - return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [INFO] [stdout] 10 + alpha.static_ty == StaticType::Any || alpha.static_ty == t [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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] 18 - return ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] 18 + ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> parser/src/typing/fill.rs:18:15 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:82:75 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(ty) = tcx.get_potentially_unique_return_type_for_function(&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: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | ... (span.clone(), format!("Ambiguous call to function '{} ({})', cannot be resolve at runtime through dynamic dispatch", &name, [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> parser/src/typing/fill.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | ... compute_ambiguous_signature(st_args, &tcx.functions[name]).and_then(|s| Some(format_signature(s))).unwrap_or("no inf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `compute_ambiguous_signature(st_args, &tcx.functions[name]).map(|s| format_signature(s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:126:14 [INFO] [stdout] | [INFO] [stdout] 126 | (span.clone(), format!("Field '{}' does not exist for the type '{}'", name, prefix_e.static_ty).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:136:18 [INFO] [stdout] | [INFO] [stdout] 136 | (span.clone(), format!("Field '{}' is not declared anywhere in any structure", name).to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | ... (span.clone(), format!("Field '{}' is not contained in a mutable structure, it cannot be assigned", name).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:196:35 [INFO] [stdout] | [INFO] [stdout] 196 | if !is_any_or(&a, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:200:35 [INFO] [stdout] | [INFO] [stdout] 200 | if !is_any_or(&b, StaticType::Int64) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:212:42 [INFO] [stdout] | [INFO] [stdout] 212 | if !is_one_of_or_any(&a, &admissible_types) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:215:42 [INFO] [stdout] | [INFO] [stdout] 215 | if !is_one_of_or_any(&b, &admissible_types) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:222:35 [INFO] [stdout] | [INFO] [stdout] 222 | if !is_any_or(&a, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:226:35 [INFO] [stdout] | [INFO] [stdout] 226 | if !is_any_or(&b, StaticType::Bool) { [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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> parser/src/typing/main.rs:11:11 [INFO] [stdout] | [INFO] [stdout] 11 | known.into_iter().map(|t| (t.clone(), vec![EnvVariable::init()])).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] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:239:35 [INFO] [stdout] | [INFO] [stdout] 239 | if !is_any_or(&e, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/fill.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | if !is_any_or(&e, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `e` [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 use of `format!` [INFO] [stdout] --> parser/src/typing/fill.rs:257:41 [INFO] [stdout] | [INFO] [stdout] 257 | ... (expr.span, format!("`div` was called here with less or more than two arguments!").to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"`div` was called here with less or more than two arguments!".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/main.rs:64:36 [INFO] [stdout] | [INFO] [stdout] 64 | verify_implicit_return(&func)?; [INFO] [stdout] | ^^^^^ help: change this to: `func` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/data.rs:17:34 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn is_builtin_function(name: &String) -> bool { [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] 17 ~ pub fn is_builtin_function(name: &str) -> bool { [INFO] [stdout] 18 ~ match name { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/data.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / match name.as_str() { [INFO] [stdout] 19 | | "println" | "div" | "print" => true, [INFO] [stdout] 20 | | _ => false [INFO] [stdout] 21 | | } [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] 18 - match name.as_str() { [INFO] [stdout] 19 - "println" | "div" | "print" => true, [INFO] [stdout] 20 - _ => false [INFO] [stdout] 21 - } [INFO] [stdout] 18 + matches!(name.as_str(), "println" | "div" | "print") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:379:29 [INFO] [stdout] | [INFO] [stdout] 379 | tcx.push_to_env(&ident, StaticType::Int64, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/fill.rs:385:30 [INFO] [stdout] | [INFO] [stdout] 385 | tcx.pop_from_env(&ident); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/data.rs:129:26 [INFO] [stdout] | [INFO] [stdout] 129 | self.push_to_env(&ident, StaticType::Any, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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: the borrowed expression implements the required traits [INFO] [stdout] --> parser/src/main.rs:19:37 [INFO] [stdout] | [INFO] [stdout] 19 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:133:61 [INFO] [stdout] | [INFO] [stdout] 133 | idents.iter().for_each(|var| self.push_local_to_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [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] --> parser/src/typing/data.rs:145:20 [INFO] [stdout] | [INFO] [stdout] 145 | if types.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `types.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/data.rs:153:56 [INFO] [stdout] | [INFO] [stdout] 153 | idents.iter().for_each(|var| self.pop_from_env(&var)); [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:159:27 [INFO] [stdout] | [INFO] [stdout] 159 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 160 | | None => None, [INFO] [stdout] 161 | | Some(var) => Some(var.ty.clone()) [INFO] [stdout] 162 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.ty.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> parser/src/typing/data.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | Some(vars) => match vars.last() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 170 | | None => None, [INFO] [stdout] 171 | | Some(var) => Some(var.scope) [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ help: try: `vars.last().map(|var| var.scope)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&ident.name).is_some()` [INFO] [stdout] --> parser/src/typing/data.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | self.environment.get(&ident.name).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&ident.name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:14:64 [INFO] [stdout] | [INFO] [stdout] 14 | ElseVal::ElseIf(e, b, rest_) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | .chain(collect_all_assign_in_array(&b.val).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] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 16 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:17:24 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).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] 17 - .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] 17 + .chain(collect_else(&rest_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:17:37 [INFO] [stdout] | [INFO] [stdout] 17 | .chain(collect_else(&rest_).into_iter()) [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/assign.rs:26:43 [INFO] [stdout] | [INFO] [stdout] 26 | Some(e) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut assigns = collect_all_assign(&e); [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / match lv.in_exp { [INFO] [stdout] 31 | | None => assigns.push(LocatedIdent::new( [INFO] [stdout] 32 | | lv.span, [INFO] [stdout] 33 | | lv.name.clone())), [INFO] [stdout] 34 | | _ => {} [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 ~ if let None = lv.in_exp { assigns.push(LocatedIdent::new( [INFO] [stdout] 31 + lv.span, [INFO] [stdout] 32 ~ lv.name.clone())) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:38:61 [INFO] [stdout] | [INFO] [stdout] 38 | ExpVal::BinOp(_, alpha, beta) => collect_all_assign(&alpha) [INFO] [stdout] | ^^^^^^ help: change this to: `alpha` [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] --> parser/src/typing/assign.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).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] 40 - .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] 40 + .chain(collect_all_assign(&beta)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | .chain(collect_all_assign(&beta).into_iter()) [INFO] [stdout] | ^^^^^ help: change this to: `beta` [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] --> parser/src/typing/assign.rs:42:53 [INFO] [stdout] | [INFO] [stdout] 42 | ExpVal::UnaryOp(_, e) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:43:61 [INFO] [stdout] | [INFO] [stdout] 43 | ExpVal::Call(_, e_s) => collect_all_assign_in_array(&e_s), [INFO] [stdout] | ^^^^ help: change this to: `e_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] --> parser/src/typing/assign.rs:45:50 [INFO] [stdout] | [INFO] [stdout] 45 | ExpVal::RMul(e, _) => collect_all_assign(&e), [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:46:61 [INFO] [stdout] | [INFO] [stdout] 46 | ExpVal::If(e, b, else_branch) => collect_all_assign(&e) [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/assign.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | .chain(collect_all_assign_in_array(&b.val).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] 48 - .chain(collect_all_assign_in_array(&b.val).into_iter()) [INFO] [stdout] 48 + .chain(collect_all_assign_in_array(&b.val)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/assign.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).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] 49 - .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] 49 + .chain(collect_else(&else_branch)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/assign.rs:49:33 [INFO] [stdout] | [INFO] [stdout] 49 | .chain(collect_else(&else_branch).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `else_branch` [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] --> parser/src/typing/returns.rs:41:36 [INFO] [stdout] | [INFO] [stdout] 41 | visit_else_returns(&rest_, expected)?; [INFO] [stdout] | ^^^^^^ help: change this to: `rest_` [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] --> parser/src/typing/returns.rs:52:27 [INFO] [stdout] | [INFO] [stdout] 52 | visit_returns(&a, expected)?; [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/returns.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | visit_returns(&b, expected)?; [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/phase1.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | fn is_reserved_name(n: &String) -> bool { [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] 8 ~ fn is_reserved_name(n: &str) -> bool { [INFO] [stdout] 9 ~ match n { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> parser/src/typing/phase1.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / match n.as_str() { [INFO] [stdout] 10 | | "div" | "print" | "println" => true, [INFO] [stdout] 11 | | _ => false [INFO] [stdout] 12 | | } [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] 9 - match n.as_str() { [INFO] [stdout] 10 - "div" | "print" | "println" => true, [INFO] [stdout] 11 - _ => false [INFO] [stdout] 12 - } [INFO] [stdout] 9 + matches!(n.as_str(), "div" | "print" | "println") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:37:34 [INFO] [stdout] | [INFO] [stdout] 37 | ...n, format!("This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before").to... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive, or it's not this structure itself or another structure declared before".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: useless use of `format!` [INFO] [stdout] --> parser/src/typing/phase1.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | ...aram.span, format!("This type is malformed, either it is not a primitive or it's not a declared before structure").to_string()).i... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"This type is malformed, either it is not a primitive or it's not a declared before structure".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/phase1.rs:97:94 [INFO] [stdout] | [INFO] [stdout] 97 | if is_callable_with_exactly(f.params.iter().map(|arg| arg.ty.clone()).collect(), &sig) { [INFO] [stdout] | ^^^^ help: change this to: `sig` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:14:65 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [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] 14 - pub fn is_this_call_ambiguous(args: Vec, functions: &Vec) -> bool { [INFO] [stdout] 14 + pub fn is_this_call_ambiguous(args: Vec, functions: &[FuncSignature]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:40:50 [INFO] [stdout] | [INFO] [stdout] 40 | sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2)... [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] 40 - sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3.into_iter()).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] 40 + sig_1.into_iter().zip(sig_2.into_iter()).zip(sig_3).map(|((s1, s2), s3)| most_precise_type(most_precise_type(s1, s2), s3)).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:47:70 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [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] 47 - pub fn compute_ambiguous_signature(args: Vec, functions: &Vec) -> Option> { [INFO] [stdout] 47 + pub fn compute_ambiguous_signature(args: Vec, functions: &[FuncSignature]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:67 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> parser/src/typing/func_signatures.rs:67:100 [INFO] [stdout] | [INFO] [stdout] 67 | return Some(compute_enriched_signature(args, f_i.1.iter().cloned().collect(), f_j.1.iter().cloned().collect())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> parser/src/typing/func_signatures.rs:75:43 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [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] 75 - pub fn compute_selectivity_weight(params: &Vec, target_sig: &FuncSignature) -> i32 { [INFO] [stdout] 75 + pub fn compute_selectivity_weight(params: &[StaticType], target_sig: &FuncSignature) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> parser/src/typing/func_signatures.rs:87:10 [INFO] [stdout] | [INFO] [stdout] 87 | .into_iter() [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: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [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] 10 - return alpha.static_ty == StaticType::Any || alpha.static_ty == t; [INFO] [stdout] 10 + alpha.static_ty == StaticType::Any || alpha.static_ty == t [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> parser/src/typing/fill.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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] 18 - return ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] 18 + ts.into_iter().any(|t| *t == alpha.static_ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> parser/src/typing/fill.rs:18:15 [INFO] [stdout] | [INFO] [stdout] 18 | return ts.into_iter().any(|t| *t == alpha.static_ty) [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:82:75 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(ty) = tcx.get_potentially_unique_return_type_for_function(&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: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | ... (span.clone(), format!("Ambiguous call to function '{} ({})', cannot be resolve at runtime through dynamic dispatch", &name, [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> parser/src/typing/fill.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | ... compute_ambiguous_signature(st_args, &tcx.functions[name]).and_then(|s| Some(format_signature(s))).unwrap_or("no inf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `compute_ambiguous_signature(st_args, &tcx.functions[name]).map(|s| format_signature(s))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:126:14 [INFO] [stdout] | [INFO] [stdout] 126 | (span.clone(), format!("Field '{}' does not exist for the type '{}'", name, prefix_e.static_ty).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:136:18 [INFO] [stdout] | [INFO] [stdout] 136 | (span.clone(), format!("Field '{}' is not declared anywhere in any structure", name).to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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 `Span<'_>` which implements the `Copy` trait [INFO] [stdout] --> parser/src/typing/fill.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | ... (span.clone(), format!("Field '{}' is not contained in a mutable structure, it cannot be assigned", name).to_string()).into() [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*span` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:196:35 [INFO] [stdout] | [INFO] [stdout] 196 | if !is_any_or(&a, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:200:35 [INFO] [stdout] | [INFO] [stdout] 200 | if !is_any_or(&b, StaticType::Int64) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:212:42 [INFO] [stdout] | [INFO] [stdout] 212 | if !is_one_of_or_any(&a, &admissible_types) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:215:42 [INFO] [stdout] | [INFO] [stdout] 215 | if !is_one_of_or_any(&b, &admissible_types) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:222:35 [INFO] [stdout] | [INFO] [stdout] 222 | if !is_any_or(&a, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `a` [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] --> parser/src/typing/fill.rs:226:35 [INFO] [stdout] | [INFO] [stdout] 226 | if !is_any_or(&b, StaticType::Bool) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:239:35 [INFO] [stdout] | [INFO] [stdout] 239 | if !is_any_or(&e, StaticType::Int64) { [INFO] [stdout] | ^^ help: change this to: `e` [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] --> parser/src/typing/fill.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | if !is_any_or(&e, StaticType::Bool) { [INFO] [stdout] | ^^ help: change this to: `e` [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 use of `format!` [INFO] [stdout] --> parser/src/typing/fill.rs:257:41 [INFO] [stdout] | [INFO] [stdout] 257 | ... (expr.span, format!("`div` was called here with less or more than two arguments!").to_string()).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"`div` was called here with less or more than two arguments!".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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> parser/src/typing/fill.rs:379:29 [INFO] [stdout] | [INFO] [stdout] 379 | tcx.push_to_env(&ident, StaticType::Int64, Scope::Local); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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] --> parser/src/typing/fill.rs:385:30 [INFO] [stdout] | [INFO] [stdout] 385 | tcx.pop_from_env(&ident); [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [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: the borrowed expression implements the required traits [INFO] [stdout] --> parser/src/main.rs:19:37 [INFO] [stdout] | [INFO] [stdout] 19 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 02s [INFO] running `Command { std: "docker" "inspect" "e3a0ddda45bbc32e5b26df52b30afdfbdc27dc712d5af2fcfe1bf7dbdbe32efa", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e3a0ddda45bbc32e5b26df52b30afdfbdc27dc712d5af2fcfe1bf7dbdbe32efa", kill_on_drop: false }` [INFO] [stdout] e3a0ddda45bbc32e5b26df52b30afdfbdc27dc712d5af2fcfe1bf7dbdbe32efa