[INFO] cloning repository https://github.com/sairash/Danfe [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/sairash/Danfe" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsairash%2FDanfe", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsairash%2FDanfe'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] af91d093c07e13d1e821c0da33bf10364f7110f9 [INFO] linting sairash/Danfe against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsairash%2FDanfe" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/sairash/Danfe [INFO] finished tweaking git repo https://github.com/sairash/Danfe [INFO] tweaked toml for git repo https://github.com/sairash/Danfe written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/sairash/Danfe 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/sairash/Danfe 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 clap v4.4.1 [INFO] [stderr] Downloaded anstyle-wincon v2.1.0 [INFO] [stderr] Downloaded anstream v0.5.0 [INFO] [stderr] Downloaded clap_lex v0.5.1 [INFO] [stderr] Downloaded clap_builder v4.4.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] fc8635bffbde04b4c3fa614f7f28499c6ff38a97f283c98c8b60df8baae84af7 [INFO] running `Command { std: "docker" "start" "-a" "fc8635bffbde04b4c3fa614f7f28499c6ff38a97f283c98c8b60df8baae84af7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "fc8635bffbde04b4c3fa614f7f28499c6ff38a97f283c98c8b60df8baae84af7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fc8635bffbde04b4c3fa614f7f28499c6ff38a97f283c98c8b60df8baae84af7", kill_on_drop: false }` [INFO] [stdout] fc8635bffbde04b4c3fa614f7f28499c6ff38a97f283c98c8b60df8baae84af7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 44e846fe56c110d10b877d718dd9e75b38e7abb17cd0dfc5fde7f40016b1e1f1 [INFO] running `Command { std: "docker" "start" "-a" "44e846fe56c110d10b877d718dd9e75b38e7abb17cd0dfc5fde7f40016b1e1f1", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.66 [INFO] [stderr] Compiling unicode-ident v1.0.11 [INFO] [stderr] Checking anstyle v1.0.2 [INFO] [stderr] Checking clap_lex v0.5.1 [INFO] [stderr] Compiling thiserror v1.0.47 [INFO] [stderr] Checking anstyle-parse v0.2.1 [INFO] [stderr] Checking anstream v0.5.0 [INFO] [stderr] Checking clap_builder v4.4.1 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling syn v2.0.29 [INFO] [stderr] Checking clap v4.4.1 [INFO] [stderr] Compiling thiserror-impl v1.0.47 [INFO] [stderr] Checking danfe v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `lexer::TokenType` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use lexer::TokenType; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::clone` [INFO] [stdout] --> src/ast.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::clone; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:143:63 [INFO] [stdout] | [INFO] [stdout] 143 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:143:73 [INFO] [stdout] | [INFO] [stdout] 143 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/parser.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | (_)=>{ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 218 - (_)=>{ [INFO] [stdout] 218 + _ =>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:231:63 [INFO] [stdout] | [INFO] [stdout] 231 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:231:73 [INFO] [stdout] | [INFO] [stdout] 231 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:249:83 [INFO] [stdout] | [INFO] [stdout] 249 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:249:93 [INFO] [stdout] | [INFO] [stdout] 249 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `lexer::TokenType` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use lexer::TokenType; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:268:63 [INFO] [stdout] | [INFO] [stdout] 268 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:268:73 [INFO] [stdout] | [INFO] [stdout] 268 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::clone` [INFO] [stdout] --> src/ast.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::clone; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:143:63 [INFO] [stdout] | [INFO] [stdout] 143 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:143:73 [INFO] [stdout] | [INFO] [stdout] 143 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/parser.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | (_)=>{ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 218 - (_)=>{ [INFO] [stdout] 218 + _ =>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:231:63 [INFO] [stdout] | [INFO] [stdout] 231 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:231:73 [INFO] [stdout] | [INFO] [stdout] 231 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:249:83 [INFO] [stdout] | [INFO] [stdout] 249 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:249:93 [INFO] [stdout] | [INFO] [stdout] 249 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:268:63 [INFO] [stdout] | [INFO] [stdout] 268 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/parser.rs:268:73 [INFO] [stdout] | [INFO] [stdout] 268 | ... self.eat(TokenType::Puncutation { raw: raw, kind: kind }); [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/parser.rs:68:15 [INFO] [stdout] | [INFO] [stdout] 68 | while let token = self.current_token.clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] = note: `#[warn(irrefutable_let_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/parser.rs:94:15 [INFO] [stdout] | [INFO] [stdout] 94 | while let token = self.current_token.clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/parser.rs:68:15 [INFO] [stdout] | [INFO] [stdout] 68 | while let token = self.current_token.clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] = note: `#[warn(irrefutable_let_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/parser.rs:94:15 [INFO] [stdout] | [INFO] [stdout] 94 | while let token = self.current_token.clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | let mut lex = lexer::Lexer::new(&text); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `MissingExpectedSymbol` is never constructed [INFO] [stdout] --> src/lexer.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 6 | pub enum LexerError { [INFO] [stdout] | ---------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 11 | MissingExpectedSymbol { expected: TokenType, found: Token }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LexerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `peek_next_token` is never used [INFO] [stdout] --> src/lexer.rs:335:12 [INFO] [stdout] | [INFO] [stdout] 80 | impl<'a> Lexer<'a> { [INFO] [stdout] | ------------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 335 | pub fn peek_next_token(&mut self) -> Result{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | Symbol(String), [INFO] [stdout] | ------ ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Literal` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 35 - Symbol(String), [INFO] [stdout] 35 + Symbol(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `String` and `Boolean` are never constructed [INFO] [stdout] --> src/ast.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 30 | pub enum Literal { [INFO] [stdout] | ------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 33 | String(String), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 34 | Boolean(bool), [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Literal` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | Define(Expr), [INFO] [stdout] | ------ ^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Operator` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 64 - Define(Expr), [INFO] [stdout] 64 + Define(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple variants are never constructed [INFO] [stdout] --> src/ast.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 40 | pub enum Operator { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 41 | UnaryPass, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 42 | UnaryMinus, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 43 | LogicalNegate, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | Minus, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 52 | [INFO] [stdout] 53 | LessThan, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 54 | GreaterThan, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 55 | LessThanOrEqual, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] 56 | GreaterThantOrEqual, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 57 | Equal, [INFO] [stdout] 58 | NotEqual, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 59 | [INFO] [stdout] 60 | BooleanAnd, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 61 | BooleanEqual, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 65 | Index, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Operator` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ParserError` is never used [INFO] [stdout] --> src/parser.rs:12:10 [INFO] [stdout] | [INFO] [stdout] 12 | pub enum ParserError { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `next` is never used [INFO] [stdout] --> src/parser.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 17 | impl <'a> Parser<'a> { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 47 | fn next(&mut self) -> Expr { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/lexer.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EOL` contains a capitalized acronym [INFO] [stdout] --> src/lexer.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | EOL, // End of Line [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:106:55 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(v) = self.balancing_state.get_mut(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | let mut lex = lexer::Lexer::new(&text); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:116:75 [INFO] [stdout] | [INFO] [stdout] 116 | if let Some(v) = self.balancing_state.get_mut(&Lexer::map_balance(&c)) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `MissingExpectedSymbol` is never constructed [INFO] [stdout] --> src/lexer.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 6 | pub enum LexerError { [INFO] [stdout] | ---------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 11 | MissingExpectedSymbol { expected: TokenType, found: Token }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LexerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:123:46 [INFO] [stdout] | [INFO] [stdout] 123 | open: Lexer::map_balance(&c) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `peek_next_token` is never used [INFO] [stdout] --> src/lexer.rs:335:12 [INFO] [stdout] | [INFO] [stdout] 80 | impl<'a> Lexer<'a> { [INFO] [stdout] | ------------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 335 | pub fn peek_next_token(&mut self) -> Result{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:129:42 [INFO] [stdout] | [INFO] [stdout] 129 | open: Lexer::map_balance(&c) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | Symbol(String), [INFO] [stdout] | ------ ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Literal` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 35 - Symbol(String), [INFO] [stdout] 35 + Symbol(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `String` and `Boolean` are never constructed [INFO] [stdout] --> src/ast.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 30 | pub enum Literal { [INFO] [stdout] | ------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 33 | String(String), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 34 | Boolean(bool), [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Literal` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/ast.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | Define(Expr), [INFO] [stdout] | ------ ^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Operator` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 64 - Define(Expr), [INFO] [stdout] 64 + Define(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/lexer.rs:159:55 [INFO] [stdout] | [INFO] [stdout] 159 | Some(c) if c.is_ascii_alphabetic() || c.is_digit(10) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple variants are never constructed [INFO] [stdout] --> src/ast.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 40 | pub enum Operator { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 41 | UnaryPass, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 42 | UnaryMinus, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 43 | LogicalNegate, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | Minus, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 52 | [INFO] [stdout] 53 | LessThan, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 54 | GreaterThan, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 55 | LessThanOrEqual, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] 56 | GreaterThantOrEqual, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 57 | Equal, [INFO] [stdout] 58 | NotEqual, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 59 | [INFO] [stdout] 60 | BooleanAnd, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 61 | BooleanEqual, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 65 | Index, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Operator` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/lexer.rs:180:28 [INFO] [stdout] | [INFO] [stdout] 180 | Some(c) if c == '\\' => { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 180 - Some(c) if c == '\\' => { [INFO] [stdout] 180 + Some('\\') => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/lexer.rs:208:55 [INFO] [stdout] | [INFO] [stdout] 208 | Some(c) if c.is_ascii_alphabetic() || c.is_digit(10) ||*c == '_' => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ParserError` is never used [INFO] [stdout] --> src/parser.rs:12:10 [INFO] [stdout] | [INFO] [stdout] 12 | pub enum ParserError { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `next` is never used [INFO] [stdout] --> src/parser.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 17 | impl <'a> Parser<'a> { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 47 | fn next(&mut self) -> Expr { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/lexer.rs:221:12 [INFO] [stdout] | [INFO] [stdout] 221 | if match identifier.as_ref() { [INFO] [stdout] | ____________^ [INFO] [stdout] 222 | | "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input" => true, [INFO] [stdout] 223 | | _ => false [INFO] [stdout] 224 | | }{ [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] 221 - if match identifier.as_ref() { [INFO] [stdout] 222 - "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input" => true, [INFO] [stdout] 223 - _ => false [INFO] [stdout] 224 - }{ [INFO] [stdout] 221 + if matches!(identifier.as_ref(), "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input"){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:261:9 [INFO] [stdout] | [INFO] [stdout] 261 | return Ok(TokenType::Operators(return_operators)); [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] 261 - return Ok(TokenType::Operators(return_operators)); [INFO] [stdout] 261 + Ok(TokenType::Operators(return_operators)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/lexer.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EOL` contains a capitalized acronym [INFO] [stdout] --> src/lexer.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | EOL, // End of Line [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/lexer.rs:284:17 [INFO] [stdout] | [INFO] [stdout] 284 | while let Some(c) = self.chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in self.chars.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:337:23 [INFO] [stdout] | [INFO] [stdout] 337 | let cur_col = self.cur_col.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.cur_col` [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/lexer.rs:338:24 [INFO] [stdout] | [INFO] [stdout] 338 | let cur_line = self.cur_line.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.cur_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 339 | let codepoint_offset = self.codepoint_offset.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.codepoint_offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:106:55 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(v) = self.balancing_state.get_mut(&c) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:116:75 [INFO] [stdout] | [INFO] [stdout] 116 | if let Some(v) = self.balancing_state.get_mut(&Lexer::map_balance(&c)) { [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/ast.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | OpExpr(Box), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` 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/lexer.rs:123:46 [INFO] [stdout] | [INFO] [stdout] 123 | open: Lexer::map_balance(&c) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer.rs:129:42 [INFO] [stdout] | [INFO] [stdout] 129 | open: Lexer::map_balance(&c) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/lexer.rs:159:55 [INFO] [stdout] | [INFO] [stdout] 159 | Some(c) if c.is_ascii_alphabetic() || c.is_digit(10) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | return lit [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] 54 - return lit [INFO] [stdout] 54 + lit [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/lexer.rs:180:28 [INFO] [stdout] | [INFO] [stdout] 180 | Some(c) if c == '\\' => { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 180 - Some(c) if c == '\\' => { [INFO] [stdout] 180 + Some('\\') => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:71:30 [INFO] [stdout] | [INFO] [stdout] 71 | if op == "+".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"+"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/lexer.rs:208:55 [INFO] [stdout] | [INFO] [stdout] 208 | Some(c) if c.is_ascii_alphabetic() || c.is_digit(10) ||*c == '_' => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:75:36 [INFO] [stdout] | [INFO] [stdout] 75 | }else if op == "-".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"-"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/lexer.rs:221:12 [INFO] [stdout] | [INFO] [stdout] 221 | if match identifier.as_ref() { [INFO] [stdout] | ____________^ [INFO] [stdout] 222 | | "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input" => true, [INFO] [stdout] 223 | | _ => false [INFO] [stdout] 224 | | }{ [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] 221 - if match identifier.as_ref() { [INFO] [stdout] 222 - "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input" => true, [INFO] [stdout] 223 - _ => false [INFO] [stdout] 224 - }{ [INFO] [stdout] 221 + if matches!(identifier.as_ref(), "false" | "true" | "proc" | "if" | "else" | "loop" | "break" | "print" | "input"){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:97:30 [INFO] [stdout] | [INFO] [stdout] 97 | if op == "/".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"/"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:101:36 [INFO] [stdout] | [INFO] [stdout] 101 | }else if op == "*".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"*"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:105:36 [INFO] [stdout] | [INFO] [stdout] 105 | }else if op == "%".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"%"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | }else if op == "==".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `"=="` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:261:9 [INFO] [stdout] | [INFO] [stdout] 261 | return Ok(TokenType::Operators(return_operators)); [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] 261 - return Ok(TokenType::Operators(return_operators)); [INFO] [stdout] 261 + Ok(TokenType::Operators(return_operators)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:166:38 [INFO] [stdout] | [INFO] [stdout] 166 | ... if op == String::from("=") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `"="` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/lexer.rs:284:17 [INFO] [stdout] | [INFO] [stdout] 284 | while let Some(c) = self.chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in self.chars.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | / loop { [INFO] [stdout] 214 | | match self.current_token { [INFO] [stdout] 215 | | TokenType::EOL=>{ [INFO] [stdout] 216 | | self.eat(TokenType::EOL) [INFO] [stdout] ... | [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________^ help: try: `while let TokenType::EOL = self.current_token { .. }` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:337:23 [INFO] [stdout] | [INFO] [stdout] 337 | let cur_col = self.cur_col.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.cur_col` [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/lexer.rs:338:24 [INFO] [stdout] | [INFO] [stdout] 338 | let cur_line = self.cur_line.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.cur_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 339 | let codepoint_offset = self.codepoint_offset.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.codepoint_offset` [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/compiler.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if !fs::metadata(output_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(output_path).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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / match fs::remove_file(format!("{}/{}", output_path, "output.asm")) { [INFO] [stdout] 23 | | Err(e) => { [INFO] [stdout] 24 | | panic!("Error While Deleting Prev File {}", e) [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ if let Err(e) = fs::remove_file(format!("{}/{}", output_path, "output.asm")) { [INFO] [stdout] 23 + panic!("Error While Deleting Prev File {}", e) [INFO] [stdout] 24 + } [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/compiler.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / match line { [INFO] [stdout] 52 | | Err(e) => { [INFO] [stdout] 53 | | panic!("Error caused while writing to file with {}", e) [INFO] [stdout] ... | [INFO] [stdout] 56 | | } [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] 51 ~ if let Err(e) = line { [INFO] [stdout] 52 + panic!("Error caused while writing to file with {}", e) [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/ast.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | OpExpr(Box), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/compiler.rs:101:20 [INFO] [stdout] | [INFO] [stdout] 101 | self.write(&*format!(" push {}", number)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&format!(" push {}", number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/compiler.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / match name.as_ref() { [INFO] [stdout] 130 | | "print" => { [INFO] [stdout] 131 | | self.write(" ;; -- dump --"); [INFO] [stdout] 132 | | self.write(" pop rdi"); [INFO] [stdout] ... | [INFO] [stdout] 135 | | _ => {} [INFO] [stdout] 136 | | } [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] 129 ~ if name.as_ref() == "print" { [INFO] [stdout] 130 + self.write(" ;; -- dump --"); [INFO] [stdout] 131 + self.write(" pop rdi"); [INFO] [stdout] 132 + self.write(" call dump") [INFO] [stdout] 133 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/compiler.rs:157:38 [INFO] [stdout] | [INFO] [stdout] 157 | Expr::OpExpr(bx_expr) => match *bx_expr { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 158 | | OpExpr { op, args } => match op { [INFO] [stdout] 159 | | Operator::Plus => { [INFO] [stdout] 160 | | self.evaluate_both_sides(args); [INFO] [stdout] ... | [INFO] [stdout] 185 | | }, [INFO] [stdout] 186 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 157 ~ Expr::OpExpr(bx_expr) => { [INFO] [stdout] 158 + let OpExpr { op, args } = *bx_expr; [INFO] [stdout] 159 + match op { [INFO] [stdout] 160 + Operator::Plus => { [INFO] [stdout] 161 + self.evaluate_both_sides(args); [INFO] [stdout] 162 + [INFO] [stdout] 163 + self.assemble_plus() [INFO] [stdout] 164 + } [INFO] [stdout] 165 + Operator::Substract => { [INFO] [stdout] 166 + self.evaluate_both_sides(args); [INFO] [stdout] 167 + [INFO] [stdout] 168 + self.assemble_minus() [INFO] [stdout] 169 + } [INFO] [stdout] 170 + Operator::Multiply => { [INFO] [stdout] 171 + self.evaluate_both_sides(args); [INFO] [stdout] 172 + [INFO] [stdout] 173 + self.assemble_multiply() [INFO] [stdout] 174 + } [INFO] [stdout] 175 + Operator::Equal => { [INFO] [stdout] 176 + self.evaluate_both_sides(args); [INFO] [stdout] 177 + [INFO] [stdout] 178 + self.assemble_equal() [INFO] [stdout] 179 + } [INFO] [stdout] 180 + Operator::Call(name) => { [INFO] [stdout] 181 + self.evaluate(args[0].clone()); [INFO] [stdout] 182 + [INFO] [stdout] 183 + self.assemble_function(name) [INFO] [stdout] 184 + } [INFO] [stdout] 185 + _ => {} [INFO] [stdout] 186 + } [INFO] [stdout] 187 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | return lit [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] 54 - return lit [INFO] [stdout] 54 + lit [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:71:30 [INFO] [stdout] | [INFO] [stdout] 71 | if op == "+".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"+"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:75:36 [INFO] [stdout] | [INFO] [stdout] 75 | }else if op == "-".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"-"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:97:30 [INFO] [stdout] | [INFO] [stdout] 97 | if op == "/".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"/"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:101:36 [INFO] [stdout] | [INFO] [stdout] 101 | }else if op == "*".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"*"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:105:36 [INFO] [stdout] | [INFO] [stdout] 105 | }else if op == "%".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"%"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | }else if op == "==".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `"=="` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [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/main.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / match matches.subcommand() { [INFO] [stdout] 30 | | Some(("file", sub_matches)) => { [INFO] [stdout] 31 | | let file_name = sub_matches.get_one::("REMOTE").expect("required"); [INFO] [stdout] 32 | | let text = std::fs::read_to_string(file_name)?; [INFO] [stdout] ... | [INFO] [stdout] 48 | | _ => {} [INFO] [stdout] 49 | | } [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] 29 ~ if let Some(("file", sub_matches)) = matches.subcommand() { [INFO] [stdout] 30 + let file_name = sub_matches.get_one::("REMOTE").expect("required"); [INFO] [stdout] 31 + let text = std::fs::read_to_string(file_name)?; [INFO] [stdout] 32 + let mut lex = lexer::Lexer::new(&text); [INFO] [stdout] 33 + [INFO] [stdout] 34 + [INFO] [stdout] 35 + let mut par = parser::Parser::new(lex); [INFO] [stdout] 36 + let par_program = par.walk(); [INFO] [stdout] 37 + [INFO] [stdout] 38 + // println!("{:#?}", par_program); [INFO] [stdout] 39 + println!("{:?}", par_program); [INFO] [stdout] 40 + let mut new_compiler = compiler::Compile::new("output"); [INFO] [stdout] 41 + [INFO] [stdout] 42 + for expr in par_program.exprs { [INFO] [stdout] 43 + new_compiler.evaluate(expr) [INFO] [stdout] 44 + } [INFO] [stdout] 45 + new_compiler.execute(); [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/parser.rs:18:41 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(mut lexer: Lexer<'a>) -> 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] 18 | pub fn new(mut lexer: Lexer<'a>) -> Parser<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/parser.rs:166:38 [INFO] [stdout] | [INFO] [stdout] 166 | ... if op == String::from("=") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `"="` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/parser.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | / loop { [INFO] [stdout] 214 | | match self.current_token { [INFO] [stdout] 215 | | TokenType::EOL=>{ [INFO] [stdout] 216 | | self.eat(TokenType::EOL) [INFO] [stdout] ... | [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________^ help: try: `while let TokenType::EOL = self.current_token { .. }` [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 boolean expression can be simplified [INFO] [stdout] --> src/compiler.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if !fs::metadata(output_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(output_path).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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / match fs::remove_file(format!("{}/{}", output_path, "output.asm")) { [INFO] [stdout] 23 | | Err(e) => { [INFO] [stdout] 24 | | panic!("Error While Deleting Prev File {}", e) [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ if let Err(e) = fs::remove_file(format!("{}/{}", output_path, "output.asm")) { [INFO] [stdout] 23 + panic!("Error While Deleting Prev File {}", e) [INFO] [stdout] 24 + } [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/compiler.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / match line { [INFO] [stdout] 52 | | Err(e) => { [INFO] [stdout] 53 | | panic!("Error caused while writing to file with {}", e) [INFO] [stdout] ... | [INFO] [stdout] 56 | | } [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] 51 ~ if let Err(e) = line { [INFO] [stdout] 52 + panic!("Error caused while writing to file with {}", e) [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/compiler.rs:101:20 [INFO] [stdout] | [INFO] [stdout] 101 | self.write(&*format!(" push {}", number)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&format!(" push {}", number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/compiler.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / match name.as_ref() { [INFO] [stdout] 130 | | "print" => { [INFO] [stdout] 131 | | self.write(" ;; -- dump --"); [INFO] [stdout] 132 | | self.write(" pop rdi"); [INFO] [stdout] ... | [INFO] [stdout] 135 | | _ => {} [INFO] [stdout] 136 | | } [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] 129 ~ if name.as_ref() == "print" { [INFO] [stdout] 130 + self.write(" ;; -- dump --"); [INFO] [stdout] 131 + self.write(" pop rdi"); [INFO] [stdout] 132 + self.write(" call dump") [INFO] [stdout] 133 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/compiler.rs:157:38 [INFO] [stdout] | [INFO] [stdout] 157 | Expr::OpExpr(bx_expr) => match *bx_expr { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 158 | | OpExpr { op, args } => match op { [INFO] [stdout] 159 | | Operator::Plus => { [INFO] [stdout] 160 | | self.evaluate_both_sides(args); [INFO] [stdout] ... | [INFO] [stdout] 185 | | }, [INFO] [stdout] 186 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 157 ~ Expr::OpExpr(bx_expr) => { [INFO] [stdout] 158 + let OpExpr { op, args } = *bx_expr; [INFO] [stdout] 159 + match op { [INFO] [stdout] 160 + Operator::Plus => { [INFO] [stdout] 161 + self.evaluate_both_sides(args); [INFO] [stdout] 162 + [INFO] [stdout] 163 + self.assemble_plus() [INFO] [stdout] 164 + } [INFO] [stdout] 165 + Operator::Substract => { [INFO] [stdout] 166 + self.evaluate_both_sides(args); [INFO] [stdout] 167 + [INFO] [stdout] 168 + self.assemble_minus() [INFO] [stdout] 169 + } [INFO] [stdout] 170 + Operator::Multiply => { [INFO] [stdout] 171 + self.evaluate_both_sides(args); [INFO] [stdout] 172 + [INFO] [stdout] 173 + self.assemble_multiply() [INFO] [stdout] 174 + } [INFO] [stdout] 175 + Operator::Equal => { [INFO] [stdout] 176 + self.evaluate_both_sides(args); [INFO] [stdout] 177 + [INFO] [stdout] 178 + self.assemble_equal() [INFO] [stdout] 179 + } [INFO] [stdout] 180 + Operator::Call(name) => { [INFO] [stdout] 181 + self.evaluate(args[0].clone()); [INFO] [stdout] 182 + [INFO] [stdout] 183 + self.assemble_function(name) [INFO] [stdout] 184 + } [INFO] [stdout] 185 + _ => {} [INFO] [stdout] 186 + } [INFO] [stdout] 187 ~ }, [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/main.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / match matches.subcommand() { [INFO] [stdout] 30 | | Some(("file", sub_matches)) => { [INFO] [stdout] 31 | | let file_name = sub_matches.get_one::("REMOTE").expect("required"); [INFO] [stdout] 32 | | let text = std::fs::read_to_string(file_name)?; [INFO] [stdout] ... | [INFO] [stdout] 48 | | _ => {} [INFO] [stdout] 49 | | } [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] 29 ~ if let Some(("file", sub_matches)) = matches.subcommand() { [INFO] [stdout] 30 + let file_name = sub_matches.get_one::("REMOTE").expect("required"); [INFO] [stdout] 31 + let text = std::fs::read_to_string(file_name)?; [INFO] [stdout] 32 + let mut lex = lexer::Lexer::new(&text); [INFO] [stdout] 33 + [INFO] [stdout] 34 + [INFO] [stdout] 35 + let mut par = parser::Parser::new(lex); [INFO] [stdout] 36 + let par_program = par.walk(); [INFO] [stdout] 37 + [INFO] [stdout] 38 + // println!("{:#?}", par_program); [INFO] [stdout] 39 + println!("{:?}", par_program); [INFO] [stdout] 40 + let mut new_compiler = compiler::Compile::new("output"); [INFO] [stdout] 41 + [INFO] [stdout] 42 + for expr in par_program.exprs { [INFO] [stdout] 43 + new_compiler.evaluate(expr) [INFO] [stdout] 44 + } [INFO] [stdout] 45 + new_compiler.execute(); [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/parser.rs:18:41 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(mut lexer: Lexer<'a>) -> 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] 18 | pub fn new(mut lexer: Lexer<'a>) -> Parser<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.31s [INFO] running `Command { std: "docker" "inspect" "44e846fe56c110d10b877d718dd9e75b38e7abb17cd0dfc5fde7f40016b1e1f1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "44e846fe56c110d10b877d718dd9e75b38e7abb17cd0dfc5fde7f40016b1e1f1", kill_on_drop: false }` [INFO] [stdout] 44e846fe56c110d10b877d718dd9e75b38e7abb17cd0dfc5fde7f40016b1e1f1