[INFO] cloning repository https://github.com/peterthejohnston/loxr [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/peterthejohnston/loxr" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterthejohnston%2Floxr", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterthejohnston%2Floxr'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 50a0a6f0f836458901cb2747fd13c80668fb6e9c [INFO] linting peterthejohnston/loxr against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterthejohnston%2Floxr" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/peterthejohnston/loxr [INFO] finished tweaking git repo https://github.com/peterthejohnston/loxr [INFO] tweaked toml for git repo https://github.com/peterthejohnston/loxr written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/peterthejohnston/loxr 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/peterthejohnston/loxr 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] Downloading crates ... [INFO] [stderr] Downloaded either v1.5.3 [INFO] [stderr] Downloaded itertools v0.8.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] c8ebe7946f356141d1b85d41dca5f629760f2c8dbd0af857df881a7e30c78445 [INFO] running `Command { std: "docker" "start" "-a" "c8ebe7946f356141d1b85d41dca5f629760f2c8dbd0af857df881a7e30c78445", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c8ebe7946f356141d1b85d41dca5f629760f2c8dbd0af857df881a7e30c78445", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c8ebe7946f356141d1b85d41dca5f629760f2c8dbd0af857df881a7e30c78445", kill_on_drop: false }` [INFO] [stdout] c8ebe7946f356141d1b85d41dca5f629760f2c8dbd0af857df881a7e30c78445 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c36205884f6141fa180e24ed15dbc6c8dfbe2ae50d1e96b8ab65c2902a459ec4 [INFO] running `Command { std: "docker" "start" "-a" "c36205884f6141fa180e24ed15dbc6c8dfbe2ae50d1e96b8ab65c2902a459ec4", kill_on_drop: false }` [INFO] [stderr] Checking either v1.5.3 [INFO] [stderr] Checking itertools v0.8.2 [INFO] [stderr] Checking lox v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variant `Tombstone` is never constructed [INFO] [stdout] --> src/table.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 20 | enum Slot { [INFO] [stdout] | ---- variant in this enum [INFO] [stdout] 21 | Empty, [INFO] [stdout] 22 | Tombstone, // Marks deleted entries [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Slot` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `delete` is never used [INFO] [stdout] --> src/table.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 41 | impl Table { [INFO] [stdout] | ---------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 117 | fn delete(&mut self, key: &str) -> bool { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `STACK_MAX` is never used [INFO] [stdout] --> src/vm.rs:7:7 [INFO] [stdout] | [INFO] [stdout] 7 | const STACK_MAX: usize = 256; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/chunk.rs:39:33 [INFO] [stdout] | [INFO] [stdout] 39 | Opcode::Error => std::u8::MAX, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 39 - Opcode::Error => std::u8::MAX, [INFO] [stdout] 39 + Opcode::Error => u8::MAX, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Chunk` [INFO] [stdout] --> src/chunk.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Chunk { [INFO] [stdout] 75 | | Chunk { [INFO] [stdout] 76 | | code: vec![], [INFO] [stdout] 77 | | lines: vec![], [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 73 + impl Default for Chunk { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/chunk.rs:151:17 [INFO] [stdout] | [INFO] [stdout] 151 | std::usize::MAX [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 151 - std::usize::MAX [INFO] [stdout] 151 + usize::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/compiler.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | / match self.previous.token_type { [INFO] [stdout] 261 | | TokenType::String => { [INFO] [stdout] 262 | | // Trim outer quotes [INFO] [stdout] 263 | | let trimmed = self.previous.lexeme[1..(self.previous.lexeme.len()-1)].to_owned(); [INFO] [stdout] ... | [INFO] [stdout] 266 | | _ => (), // Should be unreachable [INFO] [stdout] 267 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if self.previous.token_type == TokenType::String { [INFO] [stdout] 261 + // Trim outer quotes [INFO] [stdout] 262 + let trimmed = self.previous.lexeme[1..(self.previous.lexeme.len()-1)].to_owned(); [INFO] [stdout] 263 + self.emit_constant(Value::Obj(Box::new(Obj::String(trimmed)))) [INFO] [stdout] 264 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lexer.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | / match self.iter.peek() { [INFO] [stdout] 96 | | Some('.') => { [INFO] [stdout] 97 | | // Second char of lookahead to see if we should consume '.' [INFO] [stdout] 98 | | self.consume_digits(); [INFO] [stdout] 99 | | }, [INFO] [stdout] 100 | | _ => (), [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Some('.') = self.iter.peek() { [INFO] [stdout] 96 + // Second char of lookahead to see if we should consume '.' [INFO] [stdout] 97 + self.consume_digits(); [INFO] [stdout] 98 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/table.rs:32:1 [INFO] [stdout] | [INFO] [stdout] 32 | / impl Default for Table { [INFO] [stdout] 33 | | fn default() -> Self { [INFO] [stdout] 34 | | Table { [INFO] [stdout] 35 | | entries: vec![], [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 14 + #[derive(Default)] [INFO] [stdout] 15 | pub struct Table { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/table.rs:63:39 [INFO] [stdout] | [INFO] [stdout] 63 | fn find_entry<'a>(&self, entries: &'a Vec, key: &str) -> (usize, &'a Slot) { [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] 63 - fn find_entry<'a>(&self, entries: &'a Vec, key: &str) -> (usize, &'a Slot) { [INFO] [stdout] 63 + fn find_entry<'a>(&self, entries: &'a [Slot], key: &str) -> (usize, &'a Slot) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/table.rs:76:36 [INFO] [stdout] | [INFO] [stdout] 76 | return (i, &slot); [INFO] [stdout] | ^^^^^ help: change this to: `slot` [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] --> src/table.rs:90:57 [INFO] [stdout] | [INFO] [stdout] 90 | let (i, entry) = self.find_entry(&self.entries, &key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = 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 should consider adding a `Default` implementation for `VM` [INFO] [stdout] --> src/vm.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> VM { [INFO] [stdout] 21 | | VM { [INFO] [stdout] 22 | | ip: 0, [INFO] [stdout] 23 | | stack: Vec::new(), [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for VM { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vm.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | return Ok(self.ip + 1) [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] 138 - return Ok(self.ip + 1) [INFO] [stdout] 138 + Ok(self.ip + 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:176:53 [INFO] [stdout] | [INFO] [stdout] 176 | Opcode::Neg => self.unary_op(chunk, &std::ops::Neg::neg)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Neg::neg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:183:54 [INFO] [stdout] | [INFO] [stdout] 183 | Opcode::Sub => self.binary_op(chunk, &std::ops::Sub::sub)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Sub::sub` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:184:54 [INFO] [stdout] | [INFO] [stdout] 184 | Opcode::Mul => self.binary_op(chunk, &std::ops::Mul::mul)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Mul::mul` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:185:54 [INFO] [stdout] | [INFO] [stdout] 185 | Opcode::Div => self.binary_op(chunk, &std::ops::Div::div)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Div::div` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/compiler.rs:182:36 [INFO] [stdout] | [INFO] [stdout] 182 | pub fn new(source: &'a str) -> Parser { [INFO] [stdout] | -- ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 182 | pub fn new(source: &'a str) -> Parser<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 16 | if !stdin.read_line(&mut input).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stdin.read_line(&mut input).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 16 | if !stdin.read_line(&mut input).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stdin.read_line(&mut input).is_err()` [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: constant `STACK_MAX` is never used [INFO] [stdout] --> src/vm.rs:7:7 [INFO] [stdout] | [INFO] [stdout] 7 | const STACK_MAX: usize = 256; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/chunk.rs:39:33 [INFO] [stdout] | [INFO] [stdout] 39 | Opcode::Error => std::u8::MAX, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 39 - Opcode::Error => std::u8::MAX, [INFO] [stdout] 39 + Opcode::Error => u8::MAX, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Chunk` [INFO] [stdout] --> src/chunk.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Chunk { [INFO] [stdout] 75 | | Chunk { [INFO] [stdout] 76 | | code: vec![], [INFO] [stdout] 77 | | lines: vec![], [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 73 + impl Default for Chunk { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/chunk.rs:151:17 [INFO] [stdout] | [INFO] [stdout] 151 | std::usize::MAX [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 151 - std::usize::MAX [INFO] [stdout] 151 + usize::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/compiler.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | / match self.previous.token_type { [INFO] [stdout] 261 | | TokenType::String => { [INFO] [stdout] 262 | | // Trim outer quotes [INFO] [stdout] 263 | | let trimmed = self.previous.lexeme[1..(self.previous.lexeme.len()-1)].to_owned(); [INFO] [stdout] ... | [INFO] [stdout] 266 | | _ => (), // Should be unreachable [INFO] [stdout] 267 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if self.previous.token_type == TokenType::String { [INFO] [stdout] 261 + // Trim outer quotes [INFO] [stdout] 262 + let trimmed = self.previous.lexeme[1..(self.previous.lexeme.len()-1)].to_owned(); [INFO] [stdout] 263 + self.emit_constant(Value::Obj(Box::new(Obj::String(trimmed)))) [INFO] [stdout] 264 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lexer.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | / match self.iter.peek() { [INFO] [stdout] 96 | | Some('.') => { [INFO] [stdout] 97 | | // Second char of lookahead to see if we should consume '.' [INFO] [stdout] 98 | | self.consume_digits(); [INFO] [stdout] 99 | | }, [INFO] [stdout] 100 | | _ => (), [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Some('.') = self.iter.peek() { [INFO] [stdout] 96 + // Second char of lookahead to see if we should consume '.' [INFO] [stdout] 97 + self.consume_digits(); [INFO] [stdout] 98 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/table.rs:32:1 [INFO] [stdout] | [INFO] [stdout] 32 | / impl Default for Table { [INFO] [stdout] 33 | | fn default() -> Self { [INFO] [stdout] 34 | | Table { [INFO] [stdout] 35 | | entries: vec![], [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 14 + #[derive(Default)] [INFO] [stdout] 15 | pub struct Table { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/table.rs:63:39 [INFO] [stdout] | [INFO] [stdout] 63 | fn find_entry<'a>(&self, entries: &'a Vec, key: &str) -> (usize, &'a Slot) { [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] 63 - fn find_entry<'a>(&self, entries: &'a Vec, key: &str) -> (usize, &'a Slot) { [INFO] [stdout] 63 + fn find_entry<'a>(&self, entries: &'a [Slot], key: &str) -> (usize, &'a Slot) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/table.rs:76:36 [INFO] [stdout] | [INFO] [stdout] 76 | return (i, &slot); [INFO] [stdout] | ^^^^^ help: change this to: `slot` [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] --> src/table.rs:90:57 [INFO] [stdout] | [INFO] [stdout] 90 | let (i, entry) = self.find_entry(&self.entries, &key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/table.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | assert_eq!(table.delete(&i.to_string()), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 163 - assert_eq!(table.delete(&i.to_string()), true); [INFO] [stdout] 163 + assert!(table.delete(&i.to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `VM` [INFO] [stdout] --> src/vm.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> VM { [INFO] [stdout] 21 | | VM { [INFO] [stdout] 22 | | ip: 0, [INFO] [stdout] 23 | | stack: Vec::new(), [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for VM { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vm.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | return Ok(self.ip + 1) [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] 138 - return Ok(self.ip + 1) [INFO] [stdout] 138 + Ok(self.ip + 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:176:53 [INFO] [stdout] | [INFO] [stdout] 176 | Opcode::Neg => self.unary_op(chunk, &std::ops::Neg::neg)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Neg::neg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:183:54 [INFO] [stdout] | [INFO] [stdout] 183 | Opcode::Sub => self.binary_op(chunk, &std::ops::Sub::sub)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Sub::sub` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:184:54 [INFO] [stdout] | [INFO] [stdout] 184 | Opcode::Mul => self.binary_op(chunk, &std::ops::Mul::mul)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Mul::mul` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/vm.rs:185:54 [INFO] [stdout] | [INFO] [stdout] 185 | Opcode::Div => self.binary_op(chunk, &std::ops::Div::div)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `std::ops::Div::div` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/compiler.rs:182:36 [INFO] [stdout] | [INFO] [stdout] 182 | pub fn new(source: &'a str) -> Parser { [INFO] [stdout] | -- ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 182 | pub fn new(source: &'a str) -> Parser<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.30s [INFO] running `Command { std: "docker" "inspect" "c36205884f6141fa180e24ed15dbc6c8dfbe2ae50d1e96b8ab65c2902a459ec4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c36205884f6141fa180e24ed15dbc6c8dfbe2ae50d1e96b8ab65c2902a459ec4", kill_on_drop: false }` [INFO] [stdout] c36205884f6141fa180e24ed15dbc6c8dfbe2ae50d1e96b8ab65c2902a459ec4