[INFO] cloning repository https://github.com/xiaoxigua-1/ZX [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/xiaoxigua-1/ZX" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoxigua-1%2FZX", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoxigua-1%2FZX'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1f3d818fa75368156dd4ae490b085b9c28be3ce0 [INFO] linting xiaoxigua-1/ZX against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoxigua-1%2FZX" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/xiaoxigua-1/ZX [INFO] finished tweaking git repo https://github.com/xiaoxigua-1/ZX [INFO] tweaked toml for git repo https://github.com/xiaoxigua-1/ZX written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/xiaoxigua-1/ZX 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/xiaoxigua-1/ZX 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] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Updating git repository `https://github.com/TheDan64/inkwell` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded llvm-sys v100.2.3 [INFO] [stderr] Downloaded linked-list v0.0.3 [INFO] [stderr] Downloaded strum_macros v0.13.0 [INFO] [stderr] Downloaded strum v0.13.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 8a54d888ac42cbcd06ce7287f13976b8282e79189ad16ee8465db2308e9c5141 [INFO] running `Command { std: "docker" "start" "-a" "8a54d888ac42cbcd06ce7287f13976b8282e79189ad16ee8465db2308e9c5141", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8a54d888ac42cbcd06ce7287f13976b8282e79189ad16ee8465db2308e9c5141", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8a54d888ac42cbcd06ce7287f13976b8282e79189ad16ee8465db2308e9c5141", kill_on_drop: false }` [INFO] [stdout] 8a54d888ac42cbcd06ce7287f13976b8282e79189ad16ee8465db2308e9c5141 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 535d8fbd3b537191bd266051386029066039413466e7345a033e558987631887 [INFO] running `Command { std: "docker" "start" "-a" "535d8fbd3b537191bd266051386029066039413466e7345a033e558987631887", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Compiling syn v0.15.44 [INFO] [stderr] Compiling unicode-segmentation v1.9.0 [INFO] [stderr] Checking strum v0.13.0 [INFO] [stderr] Compiling syn v1.0.98 [INFO] [stderr] Compiling regex-syntax v0.6.27 [INFO] [stderr] Compiling cc v1.0.73 [INFO] [stderr] Compiling lock_api v0.4.8 [INFO] [stderr] Checking linked-list v0.0.3 [INFO] [stderr] Compiling inkwell v0.1.0 (https://github.com/TheDan64/inkwell?branch=master#75284de8) [INFO] [stderr] Compiling aho-corasick v0.7.19 [INFO] [stderr] Checking parking_lot_core v0.9.3 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling indexmap v1.9.1 [INFO] [stderr] Checking hashbrown v0.12.1 [INFO] [stderr] Compiling heck v0.4.0 [INFO] [stderr] Checking os_str_bytes v6.1.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking textwrap v0.15.0 [INFO] [stderr] Checking clap_lex v0.2.4 [INFO] [stderr] Checking parking_lot v0.12.1 [INFO] [stderr] Compiling heck v0.3.3 [INFO] [stderr] Compiling regex v1.6.0 [INFO] [stderr] Compiling strum_macros v0.13.0 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling llvm-sys v100.2.3 [INFO] [stderr] Checking util v0.1.0 (/opt/rustwide/workdir/compiler/util) [INFO] [stderr] Compiling inkwell_internals v0.5.0 (https://github.com/TheDan64/inkwell?branch=master#75284de8) [INFO] [stderr] Compiling clap_derive v3.2.7 [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> compiler/util/src/report.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn print(&self, source: &String, path: &String) { [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] 25 - pub fn print(&self, source: &String, path: &String) { [INFO] [stdout] 25 + pub fn print(&self, source: &str, path: &String) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> compiler/util/src/report.rs:119:23 [INFO] [stdout] | [INFO] [stdout] 119 | self.error.to_string(), [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: you should consider adding a `Default` implementation for `Scopes` [INFO] [stdout] --> compiler/util/src/scope.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Scopes { [INFO] [stdout] 43 | | Scopes { scopes: vec![] } [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Scopes { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:32:24 [INFO] [stdout] | [INFO] [stdout] 32 | if statements.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statements.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: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | / (0..index) [INFO] [stdout] 78 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `(0..index)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:88:16 [INFO] [stdout] | [INFO] [stdout] 88 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | fn function_parameters(&self, parameters: &Vec, index: 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] 101 - fn function_parameters(&self, parameters: &Vec, index: i32) { [INFO] [stdout] 101 + fn function_parameters(&self, parameters: &[Parameter], index: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:130:37 [INFO] [stdout] | [INFO] [stdout] 130 | self.expression(&next, index + 1); [INFO] [stdout] | ^^^^^ help: change this to: `next` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:140:27 [INFO] [stdout] | [INFO] [stdout] 140 | arguments.into_iter().for_each(|argument| { [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: deref on an immutable reference [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | self.expression(&*sub_member, index + 1); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 151 - self.expression(&*sub_member, index + 1); [INFO] [stdout] 151 + self.expression(sub_member, index + 1); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 151 | self.expression(&**sub_member, index + 1); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:172:61 [INFO] [stdout] | [INFO] [stdout] 172 | println!("{line_start}├── {}", operator_type.to_string()); [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] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:205:25 [INFO] [stdout] | [INFO] [stdout] 205 | else_statement: &Box>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:206:16 [INFO] [stdout] | [INFO] [stdout] 206 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:214:39 [INFO] [stdout] | [INFO] [stdout] 214 | self.statement(index + 1, &else_statement); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `else_statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:216:35 [INFO] [stdout] | [INFO] [stdout] 216 | self.statement(index + 1, &*block); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 216 - self.statement(index + 1, &*block); [INFO] [stdout] 216 + self.statement(index + 1, block); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 216 | self.statement(index + 1, &**block); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:219:48 [INFO] [stdout] | [INFO] [stdout] 219 | fn else_statement(&self, index: i32, next: &Box>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:223:39 [INFO] [stdout] | [INFO] [stdout] 223 | self.statement(index + 1, &next); [INFO] [stdout] | ^^^^^ help: change this to: `next` [INFO] [stdout] | [INFO] [stdout] = 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 `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | fn while_loop(&self, index: i32, block: &Box, condition: &Expression) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:231:35 [INFO] [stdout] | [INFO] [stdout] 231 | self.statement(index + 1, &**block); [INFO] [stdout] | ^^^^^^^^ help: try: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:238:15 [INFO] [stdout] | [INFO] [stdout] 238 | iter: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:239:16 [INFO] [stdout] | [INFO] [stdout] 239 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:248:35 [INFO] [stdout] | [INFO] [stdout] 248 | self.statement(index + 2, &**iter); [INFO] [stdout] | ^^^^^^^ help: try: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> compiler/util/src/report.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn print(&self, source: &String, path: &String) { [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] 25 - pub fn print(&self, source: &String, path: &String) { [INFO] [stdout] 25 + pub fn print(&self, source: &str, path: &String) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking lexer v0.1.0 (/opt/rustwide/workdir/compiler/lexer) [INFO] [stderr] Checking check v0.1.0 (/opt/rustwide/workdir/compiler/check) [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> compiler/util/src/report.rs:119:23 [INFO] [stdout] | [INFO] [stdout] 119 | self.error.to_string(), [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: you should consider adding a `Default` implementation for `Scopes` [INFO] [stdout] --> compiler/util/src/scope.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Scopes { [INFO] [stdout] 43 | | Scopes { scopes: vec![] } [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Scopes { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:32:24 [INFO] [stdout] | [INFO] [stdout] 32 | if statements.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statements.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: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | / (0..index) [INFO] [stdout] 78 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `(0..index)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:88:16 [INFO] [stdout] | [INFO] [stdout] 88 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | fn function_parameters(&self, parameters: &Vec, index: 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] 101 - fn function_parameters(&self, parameters: &Vec, index: i32) { [INFO] [stdout] 101 + fn function_parameters(&self, parameters: &[Parameter], index: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::Checker` [INFO] [stdout] --> compiler/check/src/test.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | use crate::Checker; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:130:37 [INFO] [stdout] | [INFO] [stdout] 130 | self.expression(&next, index + 1); [INFO] [stdout] | ^^^^^ help: change this to: `next` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:140:27 [INFO] [stdout] | [INFO] [stdout] 140 | arguments.into_iter().for_each(|argument| { [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: deref on an immutable reference [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | self.expression(&*sub_member, index + 1); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 151 - self.expression(&*sub_member, index + 1); [INFO] [stdout] 151 + self.expression(sub_member, index + 1); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 151 | self.expression(&**sub_member, index + 1); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:172:61 [INFO] [stdout] | [INFO] [stdout] 172 | println!("{line_start}├── {}", operator_type.to_string()); [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] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:205:25 [INFO] [stdout] | [INFO] [stdout] 205 | else_statement: &Box>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:206:16 [INFO] [stdout] | [INFO] [stdout] 206 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:214:39 [INFO] [stdout] | [INFO] [stdout] 214 | self.statement(index + 1, &else_statement); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `else_statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:216:35 [INFO] [stdout] | [INFO] [stdout] 216 | self.statement(index + 1, &*block); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 216 - self.statement(index + 1, &*block); [INFO] [stdout] 216 + self.statement(index + 1, block); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 216 | self.statement(index + 1, &**block); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:219:48 [INFO] [stdout] | [INFO] [stdout] 219 | fn else_statement(&self, index: i32, next: &Box>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:223:39 [INFO] [stdout] | [INFO] [stdout] 223 | self.statement(index + 1, &next); [INFO] [stdout] | ^^^^^ help: change this to: `next` [INFO] [stdout] | [INFO] [stdout] = 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 `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | fn while_loop(&self, index: i32, block: &Box, condition: &Expression) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `c @ _` pattern can be written as just `c` [INFO] [stdout] --> compiler/lexer/src/lex.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | c @ _ => { [INFO] [stdout] | ^^^^^ help: try: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:231:35 [INFO] [stdout] | [INFO] [stdout] 231 | self.statement(index + 1, &**block); [INFO] [stdout] | ^^^^^^^^ help: try: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:238:15 [INFO] [stdout] | [INFO] [stdout] 238 | iter: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:239:16 [INFO] [stdout] | [INFO] [stdout] 239 | block: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&Statement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> compiler/util/src/view_ast_tree.rs:248:35 [INFO] [stdout] | [INFO] [stdout] 248 | self.statement(index + 2, &**iter); [INFO] [stdout] | ^^^^^^^ help: try: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | is_eof: next_char == None, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | self.is_eof = next_char == None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/lexer/src/lex.rs:68:21 [INFO] [stdout] | [INFO] [stdout] 68 | let start = string_stream.index.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `string_stream.index` [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 `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/lexer/src/lex.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | let start = string_stream.index.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `string_stream.index` [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 `if` statement can be collapsed [INFO] [stdout] --> compiler/lexer/src/lex.rs:201:21 [INFO] [stdout] | [INFO] [stdout] 201 | / if string_stream.get_currently() == '*' { [INFO] [stdout] 202 | | if string_stream.first() == '/' { [INFO] [stdout] 203 | | end_comment = true; [INFO] [stdout] 204 | | string_stream.next(); [INFO] [stdout] ... | [INFO] [stdout] 207 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 201 ~ if string_stream.get_currently() == '*' [INFO] [stdout] 202 ~ && string_stream.first() == '/' { [INFO] [stdout] 203 | end_comment = true; [INFO] [stdout] 204 | string_stream.next(); [INFO] [stdout] 205 | break; [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> compiler/lexer/src/lex.rs:281:67 [INFO] [stdout] | [INFO] [stdout] 281 | if (is_float && number_string.len() > 1) || (!is_float && number_string.len() > 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!number_string.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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> compiler/lexer/src/lex.rs:283:13 [INFO] [stdout] | [INFO] [stdout] 283 | / match string_stream.get_currently() { [INFO] [stdout] 284 | | '.' => self.tokens.push(Token { [INFO] [stdout] 285 | | token_type: Tokens::DotToken, [INFO] [stdout] 286 | | pos: Position { [INFO] [stdout] ... | [INFO] [stdout] 291 | | _ => {} [INFO] [stdout] 292 | | } [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] 283 ~ if string_stream.get_currently() == '.' { self.tokens.push(Token { [INFO] [stdout] 284 + token_type: Tokens::DotToken, [INFO] [stdout] 285 + pos: Position { [INFO] [stdout] 286 + start: string_stream.index, [INFO] [stdout] 287 + end: string_stream.index, [INFO] [stdout] 288 + }, [INFO] [stdout] 289 + }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(s: &str) -> StringStream { [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(s: &str) -> StringStream<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ret.2` after checking its variant with `is_some` [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:213:52 [INFO] [stdout] | [INFO] [stdout] 212 | ... if ret.2.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = ret.2` [INFO] [stdout] 213 | ... bytecodes.push(ret.2.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:253:17 [INFO] [stdout] | [INFO] [stdout] 253 | / return Err(ZXError::UnknownError { [INFO] [stdout] 254 | | message: String::from("Unknown statement."), [INFO] [stdout] 255 | | }); [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] 253 ~ Err(ZXError::UnknownError { [INFO] [stdout] 254 + message: String::from("Unknown statement."), [INFO] [stdout] 255 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:58:25 [INFO] [stdout] | [INFO] [stdout] 58 | param_index = param_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `param_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:247:32 [INFO] [stdout] | [INFO] [stdout] 247 | start: left_curly_brackets.pos.start.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `left_curly_brackets.pos.start` [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 `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:248:30 [INFO] [stdout] | [INFO] [stdout] 248 | end: right_curly_brackets.pos.end.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `right_curly_brackets.pos.end` [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: module has the same name as its containing module [INFO] [stdout] --> compiler/check/src/test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod test { [INFO] [stdout] 3 | | use crate::Checker; [INFO] [stdout] 4 | | [INFO] [stdout] 5 | | #[test] [INFO] [stdout] 6 | | fn test() {} [INFO] [stdout] 7 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> compiler/check/src/lib.rs:182:50 [INFO] [stdout] | [INFO] [stdout] 182 | ... message: format!("mismatched types"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"mismatched types".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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/check/src/lib.rs:210:52 [INFO] [stdout] | [INFO] [stdout] 210 | ... return_type.to_string() [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: returning the result of a `let` binding from a block [INFO] [stdout] --> compiler/check/src/lib.rs:263:29 [INFO] [stdout] | [INFO] [stdout] 255 | / ... let ret = self [INFO] [stdout] 256 | | ... .auto_type( [INFO] [stdout] 257 | | ... global_scopes, [INFO] [stdout] 258 | | ... Some(&mut members.clone()), [INFO] [stdout] ... | [INFO] [stdout] 261 | | ... )? [INFO] [stdout] 262 | | ... .0; [INFO] [stdout] | |_____________________________- unnecessary `let` binding [INFO] [stdout] 263 | ... ret [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 255 ~ [INFO] [stdout] 256 ~ self [INFO] [stdout] 257 + .auto_type( [INFO] [stdout] 258 + global_scopes, [INFO] [stdout] 259 + Some(&mut members.clone()), [INFO] [stdout] 260 + currently, [INFO] [stdout] 261 + *next, [INFO] [stdout] 262 + )? [INFO] [stdout] 263 + .0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/check/src/lib.rs:380:20 [INFO] [stdout] | [INFO] [stdout] 380 | currently: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 380 - currently: &mut Vec, [INFO] [stdout] 380 + currently: &mut [Scopes], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking parser v0.1.0 (/opt/rustwide/workdir/compiler/parser) [INFO] [stdout] warning: the `c @ _` pattern can be written as just `c` [INFO] [stdout] --> compiler/lexer/src/lex.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | c @ _ => { [INFO] [stdout] | ^^^^^ help: try: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> compiler/lexer/tests/lexer_test.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | / match lexer.lexer() { [INFO] [stdout] 14 | | Err(error) => { [INFO] [stdout] 15 | | Report { [INFO] [stdout] 16 | | level: Level::Error, [INFO] [stdout] ... | [INFO] [stdout] 21 | | Ok(()) => {} [INFO] [stdout] 22 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Err(error) = lexer.lexer() { [INFO] [stdout] 14 + Report { [INFO] [stdout] 15 + level: Level::Error, [INFO] [stdout] 16 + error, [INFO] [stdout] 17 + } [INFO] [stdout] 18 + .print(&source, &path); [INFO] [stdout] 19 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> compiler/parser/src/lib.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | error: error, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `error` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> compiler/parser/src/lib.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | error: error, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `error` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | is_eof: next_char == None, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | self.is_eof = next_char == None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/lexer/src/lex.rs:68:21 [INFO] [stdout] | [INFO] [stdout] 68 | let start = string_stream.index.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `string_stream.index` [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 `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/lexer/src/lex.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | let start = string_stream.index.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `string_stream.index` [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 `if` statement can be collapsed [INFO] [stdout] --> compiler/lexer/src/lex.rs:201:21 [INFO] [stdout] | [INFO] [stdout] 201 | / if string_stream.get_currently() == '*' { [INFO] [stdout] 202 | | if string_stream.first() == '/' { [INFO] [stdout] 203 | | end_comment = true; [INFO] [stdout] 204 | | string_stream.next(); [INFO] [stdout] ... | [INFO] [stdout] 207 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 201 ~ if string_stream.get_currently() == '*' [INFO] [stdout] 202 ~ && string_stream.first() == '/' { [INFO] [stdout] 203 | end_comment = true; [INFO] [stdout] 204 | string_stream.next(); [INFO] [stdout] 205 | break; [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> compiler/lexer/src/lex.rs:281:67 [INFO] [stdout] | [INFO] [stdout] 281 | if (is_float && number_string.len() > 1) || (!is_float && number_string.len() > 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!number_string.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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> compiler/lexer/src/lex.rs:283:13 [INFO] [stdout] | [INFO] [stdout] 283 | / match string_stream.get_currently() { [INFO] [stdout] 284 | | '.' => self.tokens.push(Token { [INFO] [stdout] 285 | | token_type: Tokens::DotToken, [INFO] [stdout] 286 | | pos: Position { [INFO] [stdout] ... | [INFO] [stdout] 291 | | _ => {} [INFO] [stdout] 292 | | } [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] 283 ~ if string_stream.get_currently() == '.' { self.tokens.push(Token { [INFO] [stdout] 284 + token_type: Tokens::DotToken, [INFO] [stdout] 285 + pos: Position { [INFO] [stdout] 286 + start: string_stream.index, [INFO] [stdout] 287 + end: string_stream.index, [INFO] [stdout] 288 + }, [INFO] [stdout] 289 + }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/lexer/src/file_stream.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(s: &str) -> StringStream { [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(s: &str) -> StringStream<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ret.2` after checking its variant with `is_some` [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:213:52 [INFO] [stdout] | [INFO] [stdout] 212 | ... if ret.2.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = ret.2` [INFO] [stdout] 213 | ... bytecodes.push(ret.2.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:253:17 [INFO] [stdout] | [INFO] [stdout] 253 | / return Err(ZXError::UnknownError { [INFO] [stdout] 254 | | message: String::from("Unknown statement."), [INFO] [stdout] 255 | | }); [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] 253 ~ Err(ZXError::UnknownError { [INFO] [stdout] 254 + message: String::from("Unknown statement."), [INFO] [stdout] 255 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:58:25 [INFO] [stdout] | [INFO] [stdout] 58 | param_index = param_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `param_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:247:32 [INFO] [stdout] | [INFO] [stdout] 247 | start: left_curly_brackets.pos.start.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `left_curly_brackets.pos.start` [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 `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> compiler/check/src/checks/declaration.rs:248:30 [INFO] [stdout] | [INFO] [stdout] 248 | end: right_curly_brackets.pos.end.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `right_curly_brackets.pos.end` [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: useless use of `format!` [INFO] [stdout] --> compiler/check/src/lib.rs:182:50 [INFO] [stdout] | [INFO] [stdout] 182 | ... message: format!("mismatched types"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"mismatched types".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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/check/src/lib.rs:210:52 [INFO] [stdout] | [INFO] [stdout] 210 | ... return_type.to_string() [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: returning the result of a `let` binding from a block [INFO] [stdout] --> compiler/check/src/lib.rs:263:29 [INFO] [stdout] | [INFO] [stdout] 255 | / ... let ret = self [INFO] [stdout] 256 | | ... .auto_type( [INFO] [stdout] 257 | | ... global_scopes, [INFO] [stdout] 258 | | ... Some(&mut members.clone()), [INFO] [stdout] ... | [INFO] [stdout] 261 | | ... )? [INFO] [stdout] 262 | | ... .0; [INFO] [stdout] | |_____________________________- unnecessary `let` binding [INFO] [stdout] 263 | ... ret [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 255 ~ [INFO] [stdout] 256 ~ self [INFO] [stdout] 257 + .auto_type( [INFO] [stdout] 258 + global_scopes, [INFO] [stdout] 259 + Some(&mut members.clone()), [INFO] [stdout] 260 + currently, [INFO] [stdout] 261 + *next, [INFO] [stdout] 262 + )? [INFO] [stdout] 263 + .0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> compiler/parser/src/syntax/syntax_util.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match token_type { [INFO] [stdout] 35 | | Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken => true, [INFO] [stdout] 36 | | _ => false, [INFO] [stdout] 37 | | } [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] 34 - match token_type { [INFO] [stdout] 35 - Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken => true, [INFO] [stdout] 36 - _ => false, [INFO] [stdout] 37 - } [INFO] [stdout] 34 + matches!(token_type, Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> compiler/parser/src/syntax/type_syntax.rs:18:23 [INFO] [stdout] | [INFO] [stdout] 18 | nullable: !question_mark.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `question_mark.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return if let Tokens::IdentifierToken { ref literal } = keyword.token_type { [INFO] [stdout] 23 | | // Parse the statement according to the keyword [INFO] [stdout] 24 | | // The rest without a keyword is express [INFO] [stdout] 25 | | let statement = match literal.as_str() { [INFO] [stdout] ... | [INFO] [stdout] 82 | | }) [INFO] [stdout] 83 | | }; [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] 22 ~ if let Tokens::IdentifierToken { ref literal } = keyword.token_type { [INFO] [stdout] 23 + // Parse the statement according to the keyword [INFO] [stdout] 24 + // The rest without a keyword is express [INFO] [stdout] 25 + let statement = match literal.as_str() { [INFO] [stdout] 26 + "fn" => self.function_syntax()?, [INFO] [stdout] 27 + "pub" => { [INFO] [stdout] 28 + let pub_keyword = self.comparison_string(vec!["IdentifierToken"])?; [INFO] [stdout] 29 + let statement = self.statement()?; [INFO] [stdout] 30 + match statement { [INFO] [stdout] 31 + Statement::FunctionDeclaration { .. } [INFO] [stdout] 32 + | Statement::VariableDeclaration { .. } => Statement::Public { [INFO] [stdout] 33 + statement: Box::new(statement), [INFO] [stdout] 34 + }, [INFO] [stdout] 35 + _ => { [INFO] [stdout] 36 + return Err(ZXError::SyntaxError { [INFO] [stdout] 37 + message: String::from( [INFO] [stdout] 38 + "visibility `pub` is not followed by an item", [INFO] [stdout] 39 + ), [INFO] [stdout] 40 + pos: pub_keyword.pos, [INFO] [stdout] 41 + }) [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] 45 + "static" => { [INFO] [stdout] 46 + let static_keyword = self.comparison_string(vec!["IdentifierToken"])?; [INFO] [stdout] 47 + let statement = self.statement()?; [INFO] [stdout] 48 + [INFO] [stdout] 49 + match statement { [INFO] [stdout] 50 + Statement::FunctionDeclaration { .. } [INFO] [stdout] 51 + | Statement::VariableDeclaration { .. } => Statement::Static { [INFO] [stdout] 52 + statement: Box::new(statement), [INFO] [stdout] 53 + }, [INFO] [stdout] 54 + _ => { [INFO] [stdout] 55 + return Err(ZXError::SyntaxError { [INFO] [stdout] 56 + message: String::from( [INFO] [stdout] 57 + "visibility `pub` is not followed by an item", [INFO] [stdout] 58 + ), [INFO] [stdout] 59 + pos: static_keyword.pos, [INFO] [stdout] 60 + }) [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] 64 + "return" => self.return_syntax()?, [INFO] [stdout] 65 + "var" => self.variable_declaration_syntax()?, [INFO] [stdout] 66 + "if" => self.if_syntax()?, [INFO] [stdout] 67 + "while" => self.while_syntax()?, [INFO] [stdout] 68 + "for" => self.for_syntax()?, [INFO] [stdout] 69 + "class" => self.class_syntax()?, [INFO] [stdout] 70 + _ => Statement::Expression { [INFO] [stdout] 71 + expression: self.expressions(0)?, [INFO] [stdout] 72 + }, [INFO] [stdout] 73 + }; [INFO] [stdout] 74 + [INFO] [stdout] 75 + Ok(statement) [INFO] [stdout] 76 + } else if let Tokens::LeftCurlyBracketsToken = keyword.token_type { [INFO] [stdout] 77 + // left curly brackets starts with block [INFO] [stdout] 78 + Ok(self.block_syntax()?) [INFO] [stdout] 79 + } else { [INFO] [stdout] 80 + Ok(Statement::Expression { [INFO] [stdout] 81 + expression: self.expressions(0)?, [INFO] [stdout] 82 + }) [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/check/src/lib.rs:380:20 [INFO] [stdout] | [INFO] [stdout] 380 | currently: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 380 - currently: &mut Vec, [INFO] [stdout] 380 + currently: &mut [Scopes], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:171:57 [INFO] [stdout] | [INFO] [stdout] 171 | Tokens::LiteralToken { kid, .. } => match kid { [INFO] [stdout] | _________________________________________________________^ [INFO] [stdout] 172 | | Literal::PositiveInteger => { [INFO] [stdout] 173 | | let content = self.comparison_string(vec!["LiteralToken"])?; [INFO] [stdout] 174 | | Ok(Expression::Value { [INFO] [stdout] ... | [INFO] [stdout] 183 | | }), [INFO] [stdout] 184 | | }, [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:171:44 [INFO] [stdout] | [INFO] [stdout] 171 | Tokens::LiteralToken { kid, .. } => match kid { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 172 | Literal::PositiveInteger => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `kid: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:245:72 [INFO] [stdout] | [INFO] [stdout] 245 | token_type if is_operator(token_type) => operator_type(&self.currently)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `self.currently` [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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/parser/src/lib.rs:20:24 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser { [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] 20 - pub fn new(tokens: &Vec) -> Parser { [INFO] [stdout] 20 + pub fn new(tokens: &[Token]) -> Parser { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> compiler/parser/src/lib.rs:37:23 [INFO] [stdout] | [INFO] [stdout] 37 | self.next(if let Tokens::LineSeparatorToken = token { [INFO] [stdout] | _______________________^ [INFO] [stdout] 38 | | true [INFO] [stdout] 39 | | } else { [INFO] [stdout] 40 | | false [INFO] [stdout] 41 | | }); [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] 37 - self.next(if let Tokens::LineSeparatorToken = token { [INFO] [stdout] 38 - true [INFO] [stdout] 39 - } else { [INFO] [stdout] 40 - false [INFO] [stdout] 41 - }); [INFO] [stdout] 37 + self.next(matches!(token, Tokens::LineSeparatorToken)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:47:46 [INFO] [stdout] | [INFO] [stdout] 47 | self.currently.token_type.to_string(), [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | token.to_string() [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] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:67:42 [INFO] [stdout] | [INFO] [stdout] 67 | self.currently.token_type.to_string(), [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] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> compiler/parser/src/lib.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | tokens.iter().map(|&x| x).collect::>().join(", ") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tokens.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/parser/src/lib.rs:20:24 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser { [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> compiler/parser/src/syntax/syntax_util.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match token_type { [INFO] [stdout] 35 | | Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken => true, [INFO] [stdout] 36 | | _ => false, [INFO] [stdout] 37 | | } [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] 34 - match token_type { [INFO] [stdout] 35 - Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken => true, [INFO] [stdout] 36 - _ => false, [INFO] [stdout] 37 - } [INFO] [stdout] 34 + matches!(token_type, Tokens::PlusToken | Tokens::MultiplyToken | Tokens::MinusToken) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> compiler/parser/src/syntax/type_syntax.rs:18:23 [INFO] [stdout] | [INFO] [stdout] 18 | nullable: !question_mark.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `question_mark.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return if let Tokens::IdentifierToken { ref literal } = keyword.token_type { [INFO] [stdout] 23 | | // Parse the statement according to the keyword [INFO] [stdout] 24 | | // The rest without a keyword is express [INFO] [stdout] 25 | | let statement = match literal.as_str() { [INFO] [stdout] ... | [INFO] [stdout] 82 | | }) [INFO] [stdout] 83 | | }; [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] 22 ~ if let Tokens::IdentifierToken { ref literal } = keyword.token_type { [INFO] [stdout] 23 + // Parse the statement according to the keyword [INFO] [stdout] 24 + // The rest without a keyword is express [INFO] [stdout] 25 + let statement = match literal.as_str() { [INFO] [stdout] 26 + "fn" => self.function_syntax()?, [INFO] [stdout] 27 + "pub" => { [INFO] [stdout] 28 + let pub_keyword = self.comparison_string(vec!["IdentifierToken"])?; [INFO] [stdout] 29 + let statement = self.statement()?; [INFO] [stdout] 30 + match statement { [INFO] [stdout] 31 + Statement::FunctionDeclaration { .. } [INFO] [stdout] 32 + | Statement::VariableDeclaration { .. } => Statement::Public { [INFO] [stdout] 33 + statement: Box::new(statement), [INFO] [stdout] 34 + }, [INFO] [stdout] 35 + _ => { [INFO] [stdout] 36 + return Err(ZXError::SyntaxError { [INFO] [stdout] 37 + message: String::from( [INFO] [stdout] 38 + "visibility `pub` is not followed by an item", [INFO] [stdout] 39 + ), [INFO] [stdout] 40 + pos: pub_keyword.pos, [INFO] [stdout] 41 + }) [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] 45 + "static" => { [INFO] [stdout] 46 + let static_keyword = self.comparison_string(vec!["IdentifierToken"])?; [INFO] [stdout] 47 + let statement = self.statement()?; [INFO] [stdout] 48 + [INFO] [stdout] 49 + match statement { [INFO] [stdout] 50 + Statement::FunctionDeclaration { .. } [INFO] [stdout] 51 + | Statement::VariableDeclaration { .. } => Statement::Static { [INFO] [stdout] 52 + statement: Box::new(statement), [INFO] [stdout] 53 + }, [INFO] [stdout] 54 + _ => { [INFO] [stdout] 55 + return Err(ZXError::SyntaxError { [INFO] [stdout] 56 + message: String::from( [INFO] [stdout] 57 + "visibility `pub` is not followed by an item", [INFO] [stdout] 58 + ), [INFO] [stdout] 59 + pos: static_keyword.pos, [INFO] [stdout] 60 + }) [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] 64 + "return" => self.return_syntax()?, [INFO] [stdout] 65 + "var" => self.variable_declaration_syntax()?, [INFO] [stdout] 66 + "if" => self.if_syntax()?, [INFO] [stdout] 67 + "while" => self.while_syntax()?, [INFO] [stdout] 68 + "for" => self.for_syntax()?, [INFO] [stdout] 69 + "class" => self.class_syntax()?, [INFO] [stdout] 70 + _ => Statement::Expression { [INFO] [stdout] 71 + expression: self.expressions(0)?, [INFO] [stdout] 72 + }, [INFO] [stdout] 73 + }; [INFO] [stdout] 74 + [INFO] [stdout] 75 + Ok(statement) [INFO] [stdout] 76 + } else if let Tokens::LeftCurlyBracketsToken = keyword.token_type { [INFO] [stdout] 77 + // left curly brackets starts with block [INFO] [stdout] 78 + Ok(self.block_syntax()?) [INFO] [stdout] 79 + } else { [INFO] [stdout] 80 + Ok(Statement::Expression { [INFO] [stdout] 81 + expression: self.expressions(0)?, [INFO] [stdout] 82 + }) [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:171:57 [INFO] [stdout] | [INFO] [stdout] 171 | Tokens::LiteralToken { kid, .. } => match kid { [INFO] [stdout] | _________________________________________________________^ [INFO] [stdout] 172 | | Literal::PositiveInteger => { [INFO] [stdout] 173 | | let content = self.comparison_string(vec!["LiteralToken"])?; [INFO] [stdout] 174 | | Ok(Expression::Value { [INFO] [stdout] ... | [INFO] [stdout] 183 | | }), [INFO] [stdout] 184 | | }, [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:171:44 [INFO] [stdout] | [INFO] [stdout] 171 | Tokens::LiteralToken { kid, .. } => match kid { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 172 | Literal::PositiveInteger => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `kid: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> compiler/check/tests/checker_test.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use check; [INFO] [stdout] | ^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `check` [INFO] [stdout] --> compiler/check/tests/checker_test.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use check; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/parser/src/syntax/mod.rs:245:72 [INFO] [stdout] | [INFO] [stdout] 245 | token_type if is_operator(token_type) => operator_type(&self.currently)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `self.currently` [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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/parser/src/lib.rs:20:24 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser { [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] 20 - pub fn new(tokens: &Vec) -> Parser { [INFO] [stdout] 20 + pub fn new(tokens: &[Token]) -> Parser { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> compiler/parser/src/lib.rs:37:23 [INFO] [stdout] | [INFO] [stdout] 37 | self.next(if let Tokens::LineSeparatorToken = token { [INFO] [stdout] | _______________________^ [INFO] [stdout] 38 | | true [INFO] [stdout] 39 | | } else { [INFO] [stdout] 40 | | false [INFO] [stdout] 41 | | }); [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] 37 - self.next(if let Tokens::LineSeparatorToken = token { [INFO] [stdout] 38 - true [INFO] [stdout] 39 - } else { [INFO] [stdout] 40 - false [INFO] [stdout] 41 - }); [INFO] [stdout] 37 + self.next(matches!(token, Tokens::LineSeparatorToken)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:47:46 [INFO] [stdout] | [INFO] [stdout] 47 | self.currently.token_type.to_string(), [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | token.to_string() [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] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> compiler/parser/src/lib.rs:67:42 [INFO] [stdout] | [INFO] [stdout] 67 | self.currently.token_type.to_string(), [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] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> compiler/parser/src/lib.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | tokens.iter().map(|&x| x).collect::>().join(", ") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tokens.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/parser/src/lib.rs:20:24 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser { [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 20 | pub fn new(tokens: &Vec) -> Parser<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking clap v3.2.8 [INFO] [stderr] Checking llvm v0.1.0 (/opt/rustwide/workdir/compiler/llvm) [INFO] [stdout] warning: unused variable: `children` [INFO] [stdout] --> compiler/llvm/src/scope.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | children, [INFO] [stdout] | ^^^^^^^^ help: try ignoring the field: `children: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `reports` is never read [INFO] [stdout] --> compiler/llvm/src/lib.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct Builder<'a> { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | reports: Vec, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) 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] --> compiler/llvm/src/bytecodes.rs:28:15 [INFO] [stdout] | [INFO] [stdout] 28 | name: &String, [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] 28 - name: &String, [INFO] [stdout] 28 + name: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/llvm/src/bytecodes.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | bytecodes: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - bytecodes: &Vec, [INFO] [stdout] 29 + bytecodes: &[BytecodeType], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> compiler/llvm/src/scope.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | / match &scope.scope_type { [INFO] [stdout] 17 | | ScopeType::DefFunction { [INFO] [stdout] 18 | | parameters, [INFO] [stdout] 19 | | block, [INFO] [stdout] ... | [INFO] [stdout] 23 | | _ => {} [INFO] [stdout] 24 | | } [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] 16 ~ if let ScopeType::DefFunction { [INFO] [stdout] 17 + parameters, [INFO] [stdout] 18 + block, [INFO] [stdout] 19 + return_type, [INFO] [stdout] 20 + children, [INFO] [stdout] 21 + } = &scope.scope_type { self.build_function(&scope.name, parameters, return_type, block) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/llvm/src/scope.rs:30:21 [INFO] [stdout] | [INFO] [stdout] 30 | parameters: &Vec, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 ~ parameters: &[Scope], [INFO] [stdout] 31 | ret_type: &ZXTyped, [INFO] [stdout] ... [INFO] [stdout] 38 | ret_type, [INFO] [stdout] 39 ~ self.function_parameters_type(parameters.to_owned()).as_slice(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/llvm/src/scope.rs:36:13 [INFO] [stdout] | [INFO] [stdout] 36 | &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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/llvm/src/scope.rs:84:67 [INFO] [stdout] | [INFO] [stdout] 84 | ZXTyped::Other(name) => self.structs.find(&name).into(), [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: unused variable: `children` [INFO] [stdout] --> compiler/llvm/src/scope.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | children, [INFO] [stdout] | ^^^^^^^^ help: try ignoring the field: `children: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `reports` is never read [INFO] [stdout] --> compiler/llvm/src/lib.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct Builder<'a> { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | reports: Vec, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) 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] --> compiler/llvm/src/bytecodes.rs:28:15 [INFO] [stdout] | [INFO] [stdout] 28 | name: &String, [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] 28 - name: &String, [INFO] [stdout] 28 + name: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/llvm/src/bytecodes.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | bytecodes: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - bytecodes: &Vec, [INFO] [stdout] 29 + bytecodes: &[BytecodeType], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> compiler/llvm/src/scope.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | / match &scope.scope_type { [INFO] [stdout] 17 | | ScopeType::DefFunction { [INFO] [stdout] 18 | | parameters, [INFO] [stdout] 19 | | block, [INFO] [stdout] ... | [INFO] [stdout] 23 | | _ => {} [INFO] [stdout] 24 | | } [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] 16 ~ if let ScopeType::DefFunction { [INFO] [stdout] 17 + parameters, [INFO] [stdout] 18 + block, [INFO] [stdout] 19 + return_type, [INFO] [stdout] 20 + children, [INFO] [stdout] 21 + } = &scope.scope_type { self.build_function(&scope.name, parameters, return_type, block) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> compiler/llvm/src/scope.rs:30:21 [INFO] [stdout] | [INFO] [stdout] 30 | parameters: &Vec, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 ~ parameters: &[Scope], [INFO] [stdout] 31 | ret_type: &ZXTyped, [INFO] [stdout] ... [INFO] [stdout] 38 | ret_type, [INFO] [stdout] 39 ~ self.function_parameters_type(parameters.to_owned()).as_slice(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/llvm/src/scope.rs:36:13 [INFO] [stdout] | [INFO] [stdout] 36 | &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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/llvm/src/scope.rs:84:67 [INFO] [stdout] | [INFO] [stdout] 84 | ZXTyped::Other(name) => self.structs.find(&name).into(), [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: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/llvm/src/lib.rs:23:41 [INFO] [stdout] | [INFO] [stdout] 23 | pub fn new(scopes: Scopes, context: &Context) -> Builder { [INFO] [stdout] | ^^^^^^^^ ^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 23 | pub fn new(scopes: Scopes, context: &Context) -> Builder<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> compiler/llvm/src/lib.rs:23:41 [INFO] [stdout] | [INFO] [stdout] 23 | pub fn new(scopes: Scopes, context: &Context) -> Builder { [INFO] [stdout] | ^^^^^^^^ ^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided 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: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 23 | pub fn new(scopes: Scopes, context: &Context) -> Builder<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking compiler v0.1.0 (/opt/rustwide/workdir/compiler/compiler) [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> compiler/compiler/src/lib.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn compile(&self) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct pattern is not needed for a unit variant [INFO] [stdout] --> compiler/compiler/src/lib.rs:37:32 [INFO] [stdout] | [INFO] [stdout] 37 | if let Level::Debug { .. } = repost.level { [INFO] [stdout] | ^^^^^^^ help: remove the struct pattern [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern [INFO] [stdout] = note: `#[warn(clippy::unneeded_struct_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/compiler/src/lib.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | builder.compile(&Path::new("./test.bc")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new("./test.bc")` [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 returns a `Result<_, ()>` [INFO] [stdout] --> compiler/compiler/src/lib.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn compile(&self) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct pattern is not needed for a unit variant [INFO] [stdout] --> compiler/compiler/src/lib.rs:37:32 [INFO] [stdout] | [INFO] [stdout] 37 | if let Level::Debug { .. } = repost.level { [INFO] [stdout] | ^^^^^^^ help: remove the struct pattern [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern [INFO] [stdout] = note: `#[warn(clippy::unneeded_struct_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> compiler/compiler/src/lib.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | builder.compile(&Path::new("./test.bc")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new("./test.bc")` [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] [stderr] Checking cli v0.1.0 (/opt/rustwide/workdir/compiler/cli) [INFO] [stdout] warning: unused variable: `path` [INFO] [stdout] --> compiler/cli/src/lib.rs:35:33 [INFO] [stdout] | [INFO] [stdout] 35 | SubCommand::Build { path, output } => {} [INFO] [stdout] | ^^^^ help: try ignoring the field: `path: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> compiler/cli/src/lib.rs:35:39 [INFO] [stdout] | [INFO] [stdout] 35 | SubCommand::Build { path, output } => {} [INFO] [stdout] | ^^^^^^ help: try ignoring the field: `output: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking zx v0.1.0 (/opt/rustwide/workdir/compiler/main) [INFO] [stdout] warning: unused variable: `path` [INFO] [stdout] --> compiler/cli/src/lib.rs:35:33 [INFO] [stdout] | [INFO] [stdout] 35 | SubCommand::Build { path, output } => {} [INFO] [stdout] | ^^^^ help: try ignoring the field: `path: _` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> compiler/cli/src/lib.rs:35:39 [INFO] [stdout] | [INFO] [stdout] 35 | SubCommand::Build { path, output } => {} [INFO] [stdout] | ^^^^^^ help: try ignoring the field: `output: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.31s [INFO] running `Command { std: "docker" "inspect" "535d8fbd3b537191bd266051386029066039413466e7345a033e558987631887", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "535d8fbd3b537191bd266051386029066039413466e7345a033e558987631887", kill_on_drop: false }` [INFO] [stdout] 535d8fbd3b537191bd266051386029066039413466e7345a033e558987631887