[INFO] cloning repository https://github.com/jrock-3/tiny-compiler [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jrock-3/tiny-compiler" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrock-3%2Ftiny-compiler", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrock-3%2Ftiny-compiler'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 441442437221e81c9b7fe5e8d917b36a758423ae [INFO] linting jrock-3/tiny-compiler against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjrock-3%2Ftiny-compiler" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/jrock-3/tiny-compiler [INFO] finished tweaking git repo https://github.com/jrock-3/tiny-compiler [INFO] tweaked toml for git repo https://github.com/jrock-3/tiny-compiler written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jrock-3/tiny-compiler 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/jrock-3/tiny-compiler 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 anymap v0.12.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 2f46ec456200720dc6380d82806afc834764da9dc585c39917e361ecb0135bba [INFO] running `Command { std: "docker" "start" "-a" "2f46ec456200720dc6380d82806afc834764da9dc585c39917e361ecb0135bba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2f46ec456200720dc6380d82806afc834764da9dc585c39917e361ecb0135bba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2f46ec456200720dc6380d82806afc834764da9dc585c39917e361ecb0135bba", kill_on_drop: false }` [INFO] [stdout] 2f46ec456200720dc6380d82806afc834764da9dc585c39917e361ecb0135bba [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 2e065a80849694149dc6db3cd90ca4c8707675b33fee0aecf775757171f81e7d [INFO] running `Command { std: "docker" "start" "-a" "2e065a80849694149dc6db3cd90ca4c8707675b33fee0aecf775757171f81e7d", kill_on_drop: false }` [INFO] [stderr] Checking anymap v0.12.1 [INFO] [stderr] Checking project1 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the `itype @ _` pattern can be written as just `itype` [INFO] [stdout] --> src/parser_data.rs:299:13 [INFO] [stdout] | [INFO] [stdout] 299 | itype @ _ => itype, [INFO] [stdout] | ^^^^^^^^^ help: try: `itype` [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: the `itype @ _` pattern can be written as just `itype` [INFO] [stdout] --> src/parser_data.rs:450:13 [INFO] [stdout] | [INFO] [stdout] 450 | itype @ _ => itype, [INFO] [stdout] | ^^^^^^^^^ help: try: `itype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `itype @ _` pattern can be written as just `itype` [INFO] [stdout] --> src/parser_data.rs:299:13 [INFO] [stdout] | [INFO] [stdout] 299 | itype @ _ => itype, [INFO] [stdout] | ^^^^^^^^^ help: try: `itype` [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: the `itype @ _` pattern can be written as just `itype` [INFO] [stdout] --> src/parser_data.rs:450:13 [INFO] [stdout] | [INFO] [stdout] 450 | itype @ _ => itype, [INFO] [stdout] | ^^^^^^^^^ help: try: `itype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 126 | let inst = self.add_inst(self.block_state.curr(), itype); [INFO] [stdout] | --------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 127 | [INFO] [stdout] 128 | inst [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] 126 ~ [INFO] [stdout] 127 | [INFO] [stdout] 128 ~ self.add_inst(self.block_state.curr(), itype) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 139 | let inst = self.add_inst(self.block_state.curr(), itype); [INFO] [stdout] | --------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 140 | [INFO] [stdout] 141 | inst [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 139 ~ [INFO] [stdout] 140 | [INFO] [stdout] 141 ~ self.add_inst(self.block_state.curr(), itype) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | / loop { [INFO] [stdout] 172 | | if let op @ (Token::Times | Token::Divide) = self.tokenizer.peek()? { [INFO] [stdout] 173 | | self.tokenizer.next(); [INFO] [stdout] 174 | | let factor = self.factor()?; [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [INFO] [stdout] | |_____________^ help: try: `while let op @ (Token::Times | Token::Divide) = self.tokenizer.peek()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:190:17 [INFO] [stdout] | [INFO] [stdout] 190 | / loop { [INFO] [stdout] 191 | | if let op @ (Token::Plus | Token::Minus) = self.tokenizer.peek()? { [INFO] [stdout] 192 | | self.tokenizer.next(); [INFO] [stdout] 193 | | let term = self.term()?; [INFO] [stdout] ... | [INFO] [stdout] 198 | | } [INFO] [stdout] | |_________________^ help: try: `while let op @ (Token::Plus | Token::Minus) = self.tokenizer.peek()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:247:13 [INFO] [stdout] | [INFO] [stdout] 247 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return None; [INFO] [stdout] 247 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/parser.rs:314:24 [INFO] [stdout] | [INFO] [stdout] 314 | if let Some(_) = self.block_state.front().join { [INFO] [stdout] | -------^^^^^^^-------------------------------- help: try: `if self.block_state.front().join.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:345:28 [INFO] [stdout] | [INFO] [stdout] 345 | if !self.consume(Token::Comma).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.consume(Token::Comma).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args [INFO] [stdout] .expect("Should exist").get(0)` [INFO] [stdout] --> src/parser.rs:361:32 [INFO] [stdout] | [INFO] [stdout] 361 | let inst = args [INFO] [stdout] | ________________________________^ [INFO] [stdout] 362 | | .expect("Should exist") [INFO] [stdout] 363 | | .get(0) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 361 ~ let inst = args [INFO] [stdout] 362 + .expect("Should exist").first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:372:33 [INFO] [stdout] | [INFO] [stdout] 372 | let block = self.func_map.get(&id)?.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.func_map.get(&id)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:526:23 [INFO] [stdout] | [INFO] [stdout] 526 | self.add_inst(self.block_state.curr().clone(), IType::Ret { inst }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.block_state.curr()` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:549:20 [INFO] [stdout] | [INFO] [stdout] 549 | if let None = self.statement() { [INFO] [stdout] | -------^^^^------------------- help: try: `if self.statement().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:569:16 [INFO] [stdout] | [INFO] [stdout] 569 | if !self.consume(Token::Comma).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.consume(Token::Comma).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:607:13 [INFO] [stdout] | [INFO] [stdout] 607 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 607 - return None; [INFO] [stdout] 607 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:760:20 [INFO] [stdout] | [INFO] [stdout] 760 | if let None = self.blocks.get(block_id).get_first_inst(&self.insts) { [INFO] [stdout] | -------^^^^-------------------------------------------------------- help: try: `if self.blocks.get(block_id).get_first_inst(&self.insts).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser_data.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / match self { [INFO] [stdout] 131 | | &IType::Beq { inst, .. } => IType::Beq { [INFO] [stdout] 132 | | inst, [INFO] [stdout] 133 | | block: Some(block), [INFO] [stdout] ... | [INFO] [stdout] 155 | | _ => unreachable!(), [INFO] [stdout] 156 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 130 ~ match *self { [INFO] [stdout] 131 ~ IType::Beq { inst, .. } => IType::Beq { [INFO] [stdout] 132 | inst, [INFO] [stdout] 133 | block: Some(block), [INFO] [stdout] 134 | }, [INFO] [stdout] 135 ~ IType::Bne { inst, .. } => IType::Bne { [INFO] [stdout] 136 | inst, [INFO] [stdout] 137 | block: Some(block), [INFO] [stdout] 138 | }, [INFO] [stdout] 139 ~ IType::Bgt { inst, .. } => IType::Bgt { [INFO] [stdout] 140 | inst, [INFO] [stdout] 141 | block: Some(block), [INFO] [stdout] 142 | }, [INFO] [stdout] 143 ~ IType::Bge { inst, .. } => IType::Bge { [INFO] [stdout] 144 | inst, [INFO] [stdout] 145 | block: Some(block), [INFO] [stdout] 146 | }, [INFO] [stdout] 147 ~ IType::Blt { inst, .. } => IType::Blt { [INFO] [stdout] 148 | inst, [INFO] [stdout] 149 | block: Some(block), [INFO] [stdout] 150 | }, [INFO] [stdout] 151 ~ IType::Ble { inst, .. } => IType::Ble { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/parser_data.rs:637:17 [INFO] [stdout] | [INFO] [stdout] 637 | / if let IType::Empty = other { [INFO] [stdout] 638 | | true [INFO] [stdout] 639 | | } else { [INFO] [stdout] 640 | | false [INFO] [stdout] 641 | | } [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] 637 - if let IType::Empty = other { [INFO] [stdout] 638 - true [INFO] [stdout] 639 - } else { [INFO] [stdout] 640 - false [INFO] [stdout] 641 - } [INFO] [stdout] 637 + matches!(other, IType::Empty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 126 | let inst = self.add_inst(self.block_state.curr(), itype); [INFO] [stdout] | --------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 127 | [INFO] [stdout] 128 | inst [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] 126 ~ [INFO] [stdout] 127 | [INFO] [stdout] 128 ~ self.add_inst(self.block_state.curr(), itype) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 139 | let inst = self.add_inst(self.block_state.curr(), itype); [INFO] [stdout] | --------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 140 | [INFO] [stdout] 141 | inst [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 139 ~ [INFO] [stdout] 140 | [INFO] [stdout] 141 ~ self.add_inst(self.block_state.curr(), itype) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | / loop { [INFO] [stdout] 172 | | if let op @ (Token::Times | Token::Divide) = self.tokenizer.peek()? { [INFO] [stdout] 173 | | self.tokenizer.next(); [INFO] [stdout] 174 | | let factor = self.factor()?; [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [INFO] [stdout] | |_____________^ help: try: `while let op @ (Token::Times | Token::Divide) = self.tokenizer.peek()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:190:17 [INFO] [stdout] | [INFO] [stdout] 190 | / loop { [INFO] [stdout] 191 | | if let op @ (Token::Plus | Token::Minus) = self.tokenizer.peek()? { [INFO] [stdout] 192 | | self.tokenizer.next(); [INFO] [stdout] 193 | | let term = self.term()?; [INFO] [stdout] ... | [INFO] [stdout] 198 | | } [INFO] [stdout] | |_________________^ help: try: `while let op @ (Token::Plus | Token::Minus) = self.tokenizer.peek()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:247:13 [INFO] [stdout] | [INFO] [stdout] 247 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return None; [INFO] [stdout] 247 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/parser.rs:314:24 [INFO] [stdout] | [INFO] [stdout] 314 | if let Some(_) = self.block_state.front().join { [INFO] [stdout] | -------^^^^^^^-------------------------------- help: try: `if self.block_state.front().join.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser_data.rs:867:25 [INFO] [stdout] | [INFO] [stdout] 867 | .map(|inst| inst.0.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `inst.0` [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 boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:345:28 [INFO] [stdout] | [INFO] [stdout] 345 | if !self.consume(Token::Comma).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.consume(Token::Comma).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/parser_data.rs:871:9 [INFO] [stdout] | [INFO] [stdout] 871 | / self.op_map [INFO] [stdout] 872 | | .get(&OpType::try_from(itype).ok()?) [INFO] [stdout] 873 | | .map(|inst| inst.clone()) [INFO] [stdout] | |_____________________________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 871 ~ self.op_map [INFO] [stdout] 872 + .get(&OpType::try_from(itype).ok()?).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser_data.rs:873:25 [INFO] [stdout] | [INFO] [stdout] 873 | .map(|inst| inst.clone()) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*inst` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/parser_data.rs:881:9 [INFO] [stdout] | [INFO] [stdout] 881 | / self.insts [INFO] [stdout] 882 | | .iter() [INFO] [stdout] 883 | | .filter(|&inst_id| !matches!(inst_list.get(*inst_id).itype(), IType::Assignment { .. })) [INFO] [stdout] 884 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 881 ~ self.insts [INFO] [stdout] 882 + .iter().find(|&inst_id| !matches!(inst_list.get(*inst_id).itype(), IType::Assignment { .. })) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args [INFO] [stdout] .expect("Should exist").get(0)` [INFO] [stdout] --> src/parser.rs:361:32 [INFO] [stdout] | [INFO] [stdout] 361 | let inst = args [INFO] [stdout] | ________________________________^ [INFO] [stdout] 362 | | .expect("Should exist") [INFO] [stdout] 363 | | .get(0) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 361 ~ let inst = args [INFO] [stdout] 362 + .expect("Should exist").first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:372:33 [INFO] [stdout] | [INFO] [stdout] 372 | let block = self.func_map.get(&id)?.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.func_map.get(&id)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:526:23 [INFO] [stdout] | [INFO] [stdout] 526 | self.add_inst(self.block_state.curr().clone(), IType::Ret { inst }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.block_state.curr()` [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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/parser_data.rs:1061:14 [INFO] [stdout] | [INFO] [stdout] 1061 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/parser_data.rs:1086:14 [INFO] [stdout] | [INFO] [stdout] 1086 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:549:20 [INFO] [stdout] | [INFO] [stdout] 549 | if let None = self.statement() { [INFO] [stdout] | -------^^^^------------------- help: try: `if self.statement().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser.rs:569:16 [INFO] [stdout] | [INFO] [stdout] 569 | if !self.consume(Token::Comma).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.consume(Token::Comma).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:607:13 [INFO] [stdout] | [INFO] [stdout] 607 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 607 - return None; [INFO] [stdout] 607 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:9:24 [INFO] [stdout] | [INFO] [stdout] 9 | const ASCII_ZERO: u8 = '0' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | const ASCII_NINE: u8 = '9' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:11:27 [INFO] [stdout] | [INFO] [stdout] 11 | const ASCII_LOWER_A: u8 = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:12:27 [INFO] [stdout] | [INFO] [stdout] 12 | const ASCII_LOWER_Z: u8 = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:13:27 [INFO] [stdout] | [INFO] [stdout] 13 | const ASCII_UPPER_A: u8 = 'A' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:14:27 [INFO] [stdout] | [INFO] [stdout] 14 | const ASCII_UPPER_Z: u8 = 'Z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'Z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:17:25 [INFO] [stdout] | [INFO] [stdout] 17 | const ASCII_COMMA: u8 = ',' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b','` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:18:29 [INFO] [stdout] | [INFO] [stdout] 18 | const ASCII_SEMICOLON: u8 = ';' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b';'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:19:26 [INFO] [stdout] | [INFO] [stdout] 19 | const ASCII_PERIOD: u8 = '.' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'.'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:22:24 [INFO] [stdout] | [INFO] [stdout] 22 | const ASCII_PLUS: u8 = '+' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'+'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | const ASCII_MINUS: u8 = '-' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'-'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:24:28 [INFO] [stdout] | [INFO] [stdout] 24 | const ASCII_ASTERISK: u8 = '*' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'*'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | const ASCII_FORWARD_SLASH: u8 = '/' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:26:25 [INFO] [stdout] | [INFO] [stdout] 26 | const ASCII_EQUAL: u8 = '=' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'='` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:27:24 [INFO] [stdout] | [INFO] [stdout] 27 | const ASCII_BANG: u8 = '!' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'!'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:28:30 [INFO] [stdout] | [INFO] [stdout] 28 | const ASCII_LEFT_ARROW: u8 = '<' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:29:31 [INFO] [stdout] | [INFO] [stdout] 29 | const ASCII_RIGHT_ARROW: u8 = '>' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | const ASCII_SPACE: u8 = ' ' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | const ASCII_NEWLINE: u8 = '\n' as u8; [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:760:20 [INFO] [stdout] | [INFO] [stdout] 760 | if let None = self.blocks.get(block_id).get_first_inst(&self.insts) { [INFO] [stdout] | -------^^^^-------------------------------------------------------- help: try: `if self.blocks.get(block_id).get_first_inst(&self.insts).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:34:30 [INFO] [stdout] | [INFO] [stdout] 34 | const ASCII_OPEN_PAREN: u8 = '(' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'('` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:35:31 [INFO] [stdout] | [INFO] [stdout] 35 | const ASCII_CLOSE_PAREN: u8 = ')' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b')'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:36:30 [INFO] [stdout] | [INFO] [stdout] 36 | const ASCII_OPEN_BRACE: u8 = '{' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'{'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:37:31 [INFO] [stdout] | [INFO] [stdout] 37 | const ASCII_CLOSE_BRACE: u8 = '}' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'}'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer.rs:174:21 [INFO] [stdout] | [INFO] [stdout] 174 | / loop { [INFO] [stdout] 175 | | if let letter @ Some( [INFO] [stdout] 176 | | ASCII_UPPER_A..=ASCII_UPPER_Z [INFO] [stdout] 177 | | | ASCII_LOWER_A..=ASCII_LOWER_Z [INFO] [stdout] ... | [INFO] [stdout] 186 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 174 ~ while let letter @ Some( [INFO] [stdout] 175 + ASCII_UPPER_A..=ASCII_UPPER_Z [INFO] [stdout] 176 + | ASCII_LOWER_A..=ASCII_LOWER_Z [INFO] [stdout] 177 + | ASCII_ZERO..=ASCII_NINE, [INFO] [stdout] 178 + ) = self.input.peek() { .. } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/tokenizer.rs:205:29 [INFO] [stdout] | [INFO] [stdout] 205 | / ... match self.idents.iter().position(|e| e == identifier) { [INFO] [stdout] 206 | | ... Some(id) => id, [INFO] [stdout] 207 | | ... None => { [INFO] [stdout] 208 | | ... let res = self.idents.len(); [INFO] [stdout] ... | [INFO] [stdout] 214 | | ... .try_into() [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer.rs:223:21 [INFO] [stdout] | [INFO] [stdout] 223 | / loop { [INFO] [stdout] 224 | | match self.input.peek() { [INFO] [stdout] 225 | | num @ Some(ASCII_ZERO..=ASCII_NINE) => { [INFO] [stdout] 226 | | self.input.next(); [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [INFO] [stdout] | |_____________________^ help: try: `while let num @ Some(ASCII_ZERO..=ASCII_NINE) = self.input.peek() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser_data.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / match self { [INFO] [stdout] 131 | | &IType::Beq { inst, .. } => IType::Beq { [INFO] [stdout] 132 | | inst, [INFO] [stdout] 133 | | block: Some(block), [INFO] [stdout] ... | [INFO] [stdout] 155 | | _ => unreachable!(), [INFO] [stdout] 156 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 130 ~ match *self { [INFO] [stdout] 131 ~ IType::Beq { inst, .. } => IType::Beq { [INFO] [stdout] 132 | inst, [INFO] [stdout] 133 | block: Some(block), [INFO] [stdout] 134 | }, [INFO] [stdout] 135 ~ IType::Bne { inst, .. } => IType::Bne { [INFO] [stdout] 136 | inst, [INFO] [stdout] 137 | block: Some(block), [INFO] [stdout] 138 | }, [INFO] [stdout] 139 ~ IType::Bgt { inst, .. } => IType::Bgt { [INFO] [stdout] 140 | inst, [INFO] [stdout] 141 | block: Some(block), [INFO] [stdout] 142 | }, [INFO] [stdout] 143 ~ IType::Bge { inst, .. } => IType::Bge { [INFO] [stdout] 144 | inst, [INFO] [stdout] 145 | block: Some(block), [INFO] [stdout] 146 | }, [INFO] [stdout] 147 ~ IType::Blt { inst, .. } => IType::Blt { [INFO] [stdout] 148 | inst, [INFO] [stdout] 149 | block: Some(block), [INFO] [stdout] 150 | }, [INFO] [stdout] 151 ~ IType::Ble { inst, .. } => IType::Ble { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/parser_data.rs:637:17 [INFO] [stdout] | [INFO] [stdout] 637 | / if let IType::Empty = other { [INFO] [stdout] 638 | | true [INFO] [stdout] 639 | | } else { [INFO] [stdout] 640 | | false [INFO] [stdout] 641 | | } [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] 637 - if let IType::Empty = other { [INFO] [stdout] 638 - true [INFO] [stdout] 639 - } else { [INFO] [stdout] 640 - false [INFO] [stdout] 641 - } [INFO] [stdout] 637 + matches!(other, IType::Empty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser_data.rs:867:25 [INFO] [stdout] | [INFO] [stdout] 867 | .map(|inst| inst.0.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `inst.0` [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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/parser_data.rs:871:9 [INFO] [stdout] | [INFO] [stdout] 871 | / self.op_map [INFO] [stdout] 872 | | .get(&OpType::try_from(itype).ok()?) [INFO] [stdout] 873 | | .map(|inst| inst.clone()) [INFO] [stdout] | |_____________________________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 871 ~ self.op_map [INFO] [stdout] 872 + .get(&OpType::try_from(itype).ok()?).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/parser_data.rs:873:25 [INFO] [stdout] | [INFO] [stdout] 873 | .map(|inst| inst.clone()) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*inst` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/parser_data.rs:881:9 [INFO] [stdout] | [INFO] [stdout] 881 | / self.insts [INFO] [stdout] 882 | | .iter() [INFO] [stdout] 883 | | .filter(|&inst_id| !matches!(inst_list.get(*inst_id).itype(), IType::Assignment { .. })) [INFO] [stdout] 884 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 881 ~ self.insts [INFO] [stdout] 882 + .iter().find(|&inst_id| !matches!(inst_list.get(*inst_id).itype(), IType::Assignment { .. })) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/parser_data.rs:1061:14 [INFO] [stdout] | [INFO] [stdout] 1061 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/parser_data.rs:1086:14 [INFO] [stdout] | [INFO] [stdout] 1086 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:9:24 [INFO] [stdout] | [INFO] [stdout] 9 | const ASCII_ZERO: u8 = '0' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | const ASCII_NINE: u8 = '9' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:11:27 [INFO] [stdout] | [INFO] [stdout] 11 | const ASCII_LOWER_A: u8 = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:12:27 [INFO] [stdout] | [INFO] [stdout] 12 | const ASCII_LOWER_Z: u8 = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:13:27 [INFO] [stdout] | [INFO] [stdout] 13 | const ASCII_UPPER_A: u8 = 'A' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:14:27 [INFO] [stdout] | [INFO] [stdout] 14 | const ASCII_UPPER_Z: u8 = 'Z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'Z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:17:25 [INFO] [stdout] | [INFO] [stdout] 17 | const ASCII_COMMA: u8 = ',' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b','` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:18:29 [INFO] [stdout] | [INFO] [stdout] 18 | const ASCII_SEMICOLON: u8 = ';' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b';'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:19:26 [INFO] [stdout] | [INFO] [stdout] 19 | const ASCII_PERIOD: u8 = '.' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'.'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:22:24 [INFO] [stdout] | [INFO] [stdout] 22 | const ASCII_PLUS: u8 = '+' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'+'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | const ASCII_MINUS: u8 = '-' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'-'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:24:28 [INFO] [stdout] | [INFO] [stdout] 24 | const ASCII_ASTERISK: u8 = '*' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'*'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | const ASCII_FORWARD_SLASH: u8 = '/' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:26:25 [INFO] [stdout] | [INFO] [stdout] 26 | const ASCII_EQUAL: u8 = '=' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'='` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:27:24 [INFO] [stdout] | [INFO] [stdout] 27 | const ASCII_BANG: u8 = '!' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'!'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:28:30 [INFO] [stdout] | [INFO] [stdout] 28 | const ASCII_LEFT_ARROW: u8 = '<' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:29:31 [INFO] [stdout] | [INFO] [stdout] 29 | const ASCII_RIGHT_ARROW: u8 = '>' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | const ASCII_SPACE: u8 = ' ' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | const ASCII_NEWLINE: u8 = '\n' as u8; [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:34:30 [INFO] [stdout] | [INFO] [stdout] 34 | const ASCII_OPEN_PAREN: u8 = '(' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'('` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:35:31 [INFO] [stdout] | [INFO] [stdout] 35 | const ASCII_CLOSE_PAREN: u8 = ')' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b')'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:36:30 [INFO] [stdout] | [INFO] [stdout] 36 | const ASCII_OPEN_BRACE: u8 = '{' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'{'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/tokenizer.rs:37:31 [INFO] [stdout] | [INFO] [stdout] 37 | const ASCII_CLOSE_BRACE: u8 = '}' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'}'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer.rs:174:21 [INFO] [stdout] | [INFO] [stdout] 174 | / loop { [INFO] [stdout] 175 | | if let letter @ Some( [INFO] [stdout] 176 | | ASCII_UPPER_A..=ASCII_UPPER_Z [INFO] [stdout] 177 | | | ASCII_LOWER_A..=ASCII_LOWER_Z [INFO] [stdout] ... | [INFO] [stdout] 186 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 174 ~ while let letter @ Some( [INFO] [stdout] 175 + ASCII_UPPER_A..=ASCII_UPPER_Z [INFO] [stdout] 176 + | ASCII_LOWER_A..=ASCII_LOWER_Z [INFO] [stdout] 177 + | ASCII_ZERO..=ASCII_NINE, [INFO] [stdout] 178 + ) = self.input.peek() { .. } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/tokenizer.rs:205:29 [INFO] [stdout] | [INFO] [stdout] 205 | / ... match self.idents.iter().position(|e| e == identifier) { [INFO] [stdout] 206 | | ... Some(id) => id, [INFO] [stdout] 207 | | ... None => { [INFO] [stdout] 208 | | ... let res = self.idents.len(); [INFO] [stdout] ... | [INFO] [stdout] 214 | | ... .try_into() [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: this loop could be written as a `while let` loop [INFO] [stdout] --> src/tokenizer.rs:223:21 [INFO] [stdout] | [INFO] [stdout] 223 | / loop { [INFO] [stdout] 224 | | match self.input.peek() { [INFO] [stdout] 225 | | num @ Some(ASCII_ZERO..=ASCII_NINE) => { [INFO] [stdout] 226 | | self.input.next(); [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [INFO] [stdout] | |_____________________^ help: try: `while let num @ Some(ASCII_ZERO..=ASCII_NINE) = self.input.peek() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.20s [INFO] running `Command { std: "docker" "inspect" "2e065a80849694149dc6db3cd90ca4c8707675b33fee0aecf775757171f81e7d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2e065a80849694149dc6db3cd90ca4c8707675b33fee0aecf775757171f81e7d", kill_on_drop: false }` [INFO] [stdout] 2e065a80849694149dc6db3cd90ca4c8707675b33fee0aecf775757171f81e7d