[INFO] cloning repository https://github.com/utam0k/r8cc [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/utam0k/r8cc" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futam0k%2Fr8cc", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futam0k%2Fr8cc'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 60d03075da9d0a8f73d50f99b70cd2de706f7ca6 [INFO] linting utam0k/r8cc against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futam0k%2Fr8cc" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/utam0k/r8cc [INFO] finished tweaking git repo https://github.com/utam0k/r8cc [INFO] tweaked toml for git repo https://github.com/utam0k/r8cc written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/utam0k/r8cc 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/utam0k/r8cc already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] b9a8adeba10e342b23988c54ff2505efb1d56a81eab3293bf97d848618fe339f [INFO] running `Command { std: "docker" "start" "-a" "b9a8adeba10e342b23988c54ff2505efb1d56a81eab3293bf97d848618fe339f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "b9a8adeba10e342b23988c54ff2505efb1d56a81eab3293bf97d848618fe339f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b9a8adeba10e342b23988c54ff2505efb1d56a81eab3293bf97d848618fe339f", kill_on_drop: false }` [INFO] [stdout] b9a8adeba10e342b23988c54ff2505efb1d56a81eab3293bf97d848618fe339f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] a0e01314980f0dbfbe97503c0e9336a5996af9f0f96e9a95ac6ceaa43229f843 [INFO] running `Command { std: "docker" "start" "-a" "a0e01314980f0dbfbe97503c0e9336a5996af9f0f96e9a95ac6ceaa43229f843", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking lazy_static v1.0.1 [INFO] [stderr] Checking r8cc v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | '0'...'9' => read_number(c), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:149:16 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:149:28 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/stream.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | pos: pos, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `pos` [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/lib.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/lib.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | ctype: ctype, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `ctype` [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/lib.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | fname: fname, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `fname` [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/lib.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | args: args, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `args` [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/lib.rs:183:16 [INFO] [stdout] | [INFO] [stdout] 183 | Self { 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: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> src/lib.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | / lazy_static! { [INFO] [stdout] 16 | | pub static ref CONTEXT: Mutex = { [INFO] [stdout] 17 | | Mutex::new(context::Context::new()) [INFO] [stdout] 18 | | }; [INFO] [stdout] ... | [INFO] [stdout] 27 | | }; [INFO] [stdout] 28 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] = note: this warning originates in the macro `__lazy_static_create` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> src/lib.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | / lazy_static! { [INFO] [stdout] 16 | | pub static ref CONTEXT: Mutex = { [INFO] [stdout] 17 | | Mutex::new(context::Context::new()) [INFO] [stdout] 18 | | }; [INFO] [stdout] ... | [INFO] [stdout] 27 | | }; [INFO] [stdout] 28 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = note: this warning originates in the macro `__lazy_static_create` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/lib.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | let mut reg; [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: you should consider adding a `Default` implementation for `Context` [INFO] [stdout] --> src/context.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / pub fn new() -> Self { [INFO] [stdout] 14 | | Self { [INFO] [stdout] 15 | | vars: LinkedList::new(), [INFO] [stdout] 16 | | strings: LinkedList::new(), [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 12 + impl Default for Context { [INFO] [stdout] 13 + fn default() -> Self { [INFO] [stdout] 14 + Self::new() [INFO] [stdout] 15 + } [INFO] [stdout] 16 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/lex.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / match self { [INFO] [stdout] 29 | | Token::TtypePunct(punct) if punct == &c => true, [INFO] [stdout] 30 | | _ => false, [INFO] [stdout] 31 | | } [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] 28 - match self { [INFO] [stdout] 29 - Token::TtypePunct(punct) if punct == &c => true, [INFO] [stdout] 30 - _ => false, [INFO] [stdout] 31 - } [INFO] [stdout] 28 + matches!(self, Token::TtypePunct(punct) if punct == &c) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lex.rs:36:16 [INFO] [stdout] | [INFO] [stdout] 36 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `UNGOTTEN.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lex.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | let next_char: Option; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 67 | next_char = getc(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_char` here [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ let next_char: Option = getc(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lex.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | return Some(res); [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] 155 - return Some(res); [INFO] [stdout] 155 + Some(res) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lex.rs:157:9 [INFO] [stdout] | [INFO] [stdout] 157 | 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] 157 - return None; [INFO] [stdout] 157 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lex.rs:149:55 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `c` [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 `char` which implements the `Copy` trait [INFO] [stdout] --> src/lex.rs:151:35 [INFO] [stdout] | [INFO] [stdout] 151 | Token::TtypePunct(c.clone()) [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `c` [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/lex.rs:172:12 [INFO] [stdout] | [INFO] [stdout] 172 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `UNGOTTEN.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/stream.rs:58:25 [INFO] [stdout] | [INFO] [stdout] 58 | return Some(c.clone()); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/lib.rs:69:5 [INFO] [stdout] | [INFO] [stdout] 69 | / for v in vars { [INFO] [stdout] 70 | | if &v.name == name { [INFO] [stdout] 71 | | return Some(v); [INFO] [stdout] ... | [INFO] [stdout] 74 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `vars.into_iter().find(|v| &v.name == name)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/lib.rs:167:44 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 168 | | Ctype::Array(c_chars, _) => { [INFO] [stdout] 169 | | let mut s = String::new(); [INFO] [stdout] 170 | | for c_char in c_chars { [INFO] [stdout] ... | [INFO] [stdout] 178 | | _ => (), [INFO] [stdout] 179 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/lib.rs:167:30 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ^^^^^^^^^ replace this binding [INFO] [stdout] 168 | Ctype::Array(c_chars, _) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lib.rs:167:44 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 168 | | Ctype::Array(c_chars, _) => { [INFO] [stdout] 169 | | let mut s = String::new(); [INFO] [stdout] 170 | | for c_char in c_chars { [INFO] [stdout] ... | [INFO] [stdout] 178 | | _ => (), [INFO] [stdout] 179 | | }, [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] 167 ~ AstKind::Literal(ref ctype) => if let Ctype::Array(c_chars, _) = ctype { [INFO] [stdout] 168 + let mut s = String::new(); [INFO] [stdout] 169 + for c_char in c_chars { [INFO] [stdout] 170 + match c_char { [INFO] [stdout] 171 + Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] 172 + _ => unreachable!(), [INFO] [stdout] 173 + } [INFO] [stdout] 174 + } [INFO] [stdout] 175 + CONTEXT.lock().unwrap().push_string(s); [INFO] [stdout] 176 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:172:54 [INFO] [stdout] | [INFO] [stdout] 172 | ... Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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: implementation of inherent method `to_string(&self) -> String` for type `Ast` [INFO] [stdout] --> src/lib.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / pub fn to_string(&self) -> String { [INFO] [stdout] 208 | | self.to_string_int() [INFO] [stdout] 209 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `Ast` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `REGS` [INFO] [stdout] --> src/lib.rs:234:26 [INFO] [stdout] | [INFO] [stdout] 234 | for i in 1..args_len { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 234 - for i in 1..args_len { [INFO] [stdout] 234 + for in REGS.iter().take(args_len).skip(1) { [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/lib.rs:253:17 [INFO] [stdout] | [INFO] [stdout] 253 | / match operand.kind { [INFO] [stdout] 254 | | AstKind::Var(ref var) => print!("lea -{}(%rbp), %rax\n\t", var.vpos * 8), [INFO] [stdout] 255 | | _ => (), [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________________^ help: try: `if let AstKind::Var(ref var) = operand.kind { print!("lea -{}(%rbp), %rax\n\t", var.vpos * 8) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/lib.rs:281:34 [INFO] [stdout] | [INFO] [stdout] 281 | fn emit_assign(&self, value: &Box) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `&Self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lib.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | let op: &str; [INFO] [stdout] | ^^^^^^^^^^^^^ created here [INFO] [stdout] ... [INFO] [stdout] 302 | / op = match self.kind { [INFO] [stdout] 303 | | AstKind::Binop(kind, _, ref left, ref right) => match kind { [INFO] [stdout] 304 | | '=' => { [INFO] [stdout] 305 | | left.emit_assign(right); [INFO] [stdout] ... | [INFO] [stdout] 314 | | _ => panic!("invalid operand"), [INFO] [stdout] 315 | | }; [INFO] [stdout] | |_________^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `op` here [INFO] [stdout] | [INFO] [stdout] 290 ~ [INFO] [stdout] 291 | if let Some(ctype) = self.get_ctype() { [INFO] [stdout] ... [INFO] [stdout] 301 | } [INFO] [stdout] 302 ~ let op: &str = match self.kind { [INFO] [stdout] 303 + AstKind::Binop(kind, _, ref left, ref right) => match kind { [INFO] [stdout] 304 + '=' => { [INFO] [stdout] 305 + left.emit_assign(right); [INFO] [stdout] 306 + return; [INFO] [stdout] 307 + } [INFO] [stdout] 308 + '+' => "add", [INFO] [stdout] 309 + '-' => "sub", [INFO] [stdout] 310 + '*' => "imul", [INFO] [stdout] 311 + '/' => "", [INFO] [stdout] 312 + _ => panic!("invalid operand"), [INFO] [stdout] 313 + }, [INFO] [stdout] 314 + _ => panic!("invalid operand"), [INFO] [stdout] 315 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:355:54 [INFO] [stdout] | [INFO] [stdout] 355 | ... Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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/lib.rs:411:40 [INFO] [stdout] | [INFO] [stdout] 411 | Addr(_, ref ctype) => Some(&ctype), [INFO] [stdout] | ^^^^^^ help: change this to: `ctype` [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/lib.rs:412:41 [INFO] [stdout] | [INFO] [stdout] 412 | Deref(_, ref ctype) => Some(&ctype), [INFO] [stdout] | ^^^^^^ help: change this to: `ctype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lib.rs:420:5 [INFO] [stdout] | [INFO] [stdout] 420 | let types; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `types` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 420 ~ [INFO] [stdout] 421 ~ let types = if a_type > b_type { [INFO] [stdout] 422 ~ (b_type, a_type) [INFO] [stdout] 423 | } else { [INFO] [stdout] 424 ~ (a_type, b_type) [INFO] [stdout] 425 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:438:30 [INFO] [stdout] | [INFO] [stdout] 438 | Int(a) => return Int(a.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*a` [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 `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:439:31 [INFO] [stdout] | [INFO] [stdout] 439 | Char(a) => return Int(a.clone() as i32), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*a` [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/lib.rs:440:84 [INFO] [stdout] | [INFO] [stdout] 440 | Array(_, _) => return result_type_int(op, &Ptr(Box::new(types.0.clone())), &types.1), [INFO] [stdout] | ^^^^^^^^ help: change this to: `types.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:508:9 [INFO] [stdout] | [INFO] [stdout] 508 | / return Some(match token { [INFO] [stdout] 509 | | TtypeIdent(sval) => read_ident_or_func(sval), [INFO] [stdout] 510 | | TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] 511 | | TtypeChar(c) => Ast::make_char(c), [INFO] [stdout] 512 | | TtypeString(sval) => Ast::make_string(sval), [INFO] [stdout] 513 | | TtypePunct(punct) => panic!("unexpected character: '{}'", punct), [INFO] [stdout] 514 | | }); [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] 508 ~ Some(match token { [INFO] [stdout] 509 + TtypeIdent(sval) => read_ident_or_func(sval), [INFO] [stdout] 510 + TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] 511 + TtypeChar(c) => Ast::make_char(c), [INFO] [stdout] 512 + TtypeString(sval) => Ast::make_string(sval), [INFO] [stdout] 513 + TtypePunct(punct) => panic!("unexpected character: '{}'", punct), [INFO] [stdout] 514 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:516:9 [INFO] [stdout] | [INFO] [stdout] 516 | 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] 516 - return None; [INFO] [stdout] 516 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/lib.rs:510:45 [INFO] [stdout] | [INFO] [stdout] 510 | TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] | ^^^^^^^^^^^ help: try: `ival` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lib.rs:622:13 [INFO] [stdout] | [INFO] [stdout] 622 | fn quote(q: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 622 - fn quote(q: &String) -> String { [INFO] [stdout] 622 + fn quote(q: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/lib.rs:626:13 [INFO] [stdout] | [INFO] [stdout] 626 | buf.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `buf.push('\\')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:639:5 [INFO] [stdout] | [INFO] [stdout] 639 | print!("\t.data\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 639 - print!("\t.data\n"); [INFO] [stdout] 639 + println!("\t.data"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 642 - print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] 642 + println!(".string \"{}\"", quote(&p)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:642:42 [INFO] [stdout] | [INFO] [stdout] 642 | print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] | ^^ help: change this to: `p` [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: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:172:13 [INFO] [stdout] | [INFO] [stdout] 172 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:173:23 [INFO] [stdout] | [INFO] [stdout] 173 | let tok = UNGOTTEN.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | '0'...'9' => read_number(c), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:149:16 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lex.rs:149:28 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/stream.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | pos: pos, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `pos` [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/lib.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/lib.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | ctype: ctype, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `ctype` [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/lib.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | fname: fname, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `fname` [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/lib.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | args: args, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `args` [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/lib.rs:183:16 [INFO] [stdout] | [INFO] [stdout] 183 | Self { 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: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> src/lib.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | / lazy_static! { [INFO] [stdout] 16 | | pub static ref CONTEXT: Mutex = { [INFO] [stdout] 17 | | Mutex::new(context::Context::new()) [INFO] [stdout] 18 | | }; [INFO] [stdout] ... | [INFO] [stdout] 27 | | }; [INFO] [stdout] 28 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] = note: this warning originates in the macro `__lazy_static_create` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated constant `std::sync::ONCE_INIT`: the `Once::new()` function is now preferred [INFO] [stdout] --> src/lib.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | / lazy_static! { [INFO] [stdout] 16 | | pub static ref CONTEXT: Mutex = { [INFO] [stdout] 17 | | Mutex::new(context::Context::new()) [INFO] [stdout] 18 | | }; [INFO] [stdout] ... | [INFO] [stdout] 27 | | }; [INFO] [stdout] 28 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = note: this warning originates in the macro `__lazy_static_create` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / loop { [INFO] [stdout] 10 | | if let Some(t) = r8cc::read_decl_or_stmt() { [INFO] [stdout] 11 | | exprs.push(t); [INFO] [stdout] 12 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(t) = r8cc::read_decl_or_stmt() { .. }` [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 `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/main.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | print!(".global mymain\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 19 - print!(".global mymain\n"); [INFO] [stdout] 19 + println!(".global mymain"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/main.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | print!("ret\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 41 - print!("ret\n"); [INFO] [stdout] 41 + println!("ret"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / loop { [INFO] [stdout] 10 | | if let Some(t) = r8cc::read_decl_or_stmt() { [INFO] [stdout] 11 | | exprs.push(t); [INFO] [stdout] 12 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(t) = r8cc::read_decl_or_stmt() { .. }` [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 `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/main.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | print!(".global mymain\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 19 - print!(".global mymain\n"); [INFO] [stdout] 19 + println!(".global mymain"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/main.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | print!("ret\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 41 - print!("ret\n"); [INFO] [stdout] 41 + println!("ret"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/lib.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | let mut reg; [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: you should consider adding a `Default` implementation for `Context` [INFO] [stdout] --> src/context.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / pub fn new() -> Self { [INFO] [stdout] 14 | | Self { [INFO] [stdout] 15 | | vars: LinkedList::new(), [INFO] [stdout] 16 | | strings: LinkedList::new(), [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 12 + impl Default for Context { [INFO] [stdout] 13 + fn default() -> Self { [INFO] [stdout] 14 + Self::new() [INFO] [stdout] 15 + } [INFO] [stdout] 16 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/lex.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / match self { [INFO] [stdout] 29 | | Token::TtypePunct(punct) if punct == &c => true, [INFO] [stdout] 30 | | _ => false, [INFO] [stdout] 31 | | } [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] 28 - match self { [INFO] [stdout] 29 - Token::TtypePunct(punct) if punct == &c => true, [INFO] [stdout] 30 - _ => false, [INFO] [stdout] 31 - } [INFO] [stdout] 28 + matches!(self, Token::TtypePunct(punct) if punct == &c) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lex.rs:36:16 [INFO] [stdout] | [INFO] [stdout] 36 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `UNGOTTEN.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lex.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | let next_char: Option; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 67 | next_char = getc(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_char` here [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ let next_char: Option = getc(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lex.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | return Some(res); [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] 155 - return Some(res); [INFO] [stdout] 155 + Some(res) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lex.rs:157:9 [INFO] [stdout] | [INFO] [stdout] 157 | 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] 157 - return None; [INFO] [stdout] 157 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lex.rs:149:55 [INFO] [stdout] | [INFO] [stdout] 149 | 'a'...'z' | 'A'...'Z' | '_' => read_ident(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `c` [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 `char` which implements the `Copy` trait [INFO] [stdout] --> src/lex.rs:151:35 [INFO] [stdout] | [INFO] [stdout] 151 | Token::TtypePunct(c.clone()) [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `c` [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/lex.rs:172:12 [INFO] [stdout] | [INFO] [stdout] 172 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `UNGOTTEN.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/stream.rs:58:25 [INFO] [stdout] | [INFO] [stdout] 58 | return Some(c.clone()); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/lib.rs:69:5 [INFO] [stdout] | [INFO] [stdout] 69 | / for v in vars { [INFO] [stdout] 70 | | if &v.name == name { [INFO] [stdout] 71 | | return Some(v); [INFO] [stdout] ... | [INFO] [stdout] 74 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `vars.into_iter().find(|v| &v.name == name)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/lib.rs:167:44 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 168 | | Ctype::Array(c_chars, _) => { [INFO] [stdout] 169 | | let mut s = String::new(); [INFO] [stdout] 170 | | for c_char in c_chars { [INFO] [stdout] ... | [INFO] [stdout] 178 | | _ => (), [INFO] [stdout] 179 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/lib.rs:167:30 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ^^^^^^^^^ replace this binding [INFO] [stdout] 168 | Ctype::Array(c_chars, _) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lib.rs:167:44 [INFO] [stdout] | [INFO] [stdout] 167 | AstKind::Literal(ref ctype) => match ctype { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 168 | | Ctype::Array(c_chars, _) => { [INFO] [stdout] 169 | | let mut s = String::new(); [INFO] [stdout] 170 | | for c_char in c_chars { [INFO] [stdout] ... | [INFO] [stdout] 178 | | _ => (), [INFO] [stdout] 179 | | }, [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] 167 ~ AstKind::Literal(ref ctype) => if let Ctype::Array(c_chars, _) = ctype { [INFO] [stdout] 168 + let mut s = String::new(); [INFO] [stdout] 169 + for c_char in c_chars { [INFO] [stdout] 170 + match c_char { [INFO] [stdout] 171 + Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] 172 + _ => unreachable!(), [INFO] [stdout] 173 + } [INFO] [stdout] 174 + } [INFO] [stdout] 175 + CONTEXT.lock().unwrap().push_string(s); [INFO] [stdout] 176 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:172:54 [INFO] [stdout] | [INFO] [stdout] 172 | ... Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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: implementation of inherent method `to_string(&self) -> String` for type `Ast` [INFO] [stdout] --> src/lib.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / pub fn to_string(&self) -> String { [INFO] [stdout] 208 | | self.to_string_int() [INFO] [stdout] 209 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `Ast` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `REGS` [INFO] [stdout] --> src/lib.rs:234:26 [INFO] [stdout] | [INFO] [stdout] 234 | for i in 1..args_len { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 234 - for i in 1..args_len { [INFO] [stdout] 234 + for in REGS.iter().take(args_len).skip(1) { [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/lib.rs:253:17 [INFO] [stdout] | [INFO] [stdout] 253 | / match operand.kind { [INFO] [stdout] 254 | | AstKind::Var(ref var) => print!("lea -{}(%rbp), %rax\n\t", var.vpos * 8), [INFO] [stdout] 255 | | _ => (), [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________________^ help: try: `if let AstKind::Var(ref var) = operand.kind { print!("lea -{}(%rbp), %rax\n\t", var.vpos * 8) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/lib.rs:281:34 [INFO] [stdout] | [INFO] [stdout] 281 | fn emit_assign(&self, value: &Box) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `&Self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lib.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | let op: &str; [INFO] [stdout] | ^^^^^^^^^^^^^ created here [INFO] [stdout] ... [INFO] [stdout] 302 | / op = match self.kind { [INFO] [stdout] 303 | | AstKind::Binop(kind, _, ref left, ref right) => match kind { [INFO] [stdout] 304 | | '=' => { [INFO] [stdout] 305 | | left.emit_assign(right); [INFO] [stdout] ... | [INFO] [stdout] 314 | | _ => panic!("invalid operand"), [INFO] [stdout] 315 | | }; [INFO] [stdout] | |_________^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `op` here [INFO] [stdout] | [INFO] [stdout] 290 ~ [INFO] [stdout] 291 | if let Some(ctype) = self.get_ctype() { [INFO] [stdout] ... [INFO] [stdout] 301 | } [INFO] [stdout] 302 ~ let op: &str = match self.kind { [INFO] [stdout] 303 + AstKind::Binop(kind, _, ref left, ref right) => match kind { [INFO] [stdout] 304 + '=' => { [INFO] [stdout] 305 + left.emit_assign(right); [INFO] [stdout] 306 + return; [INFO] [stdout] 307 + } [INFO] [stdout] 308 + '+' => "add", [INFO] [stdout] 309 + '-' => "sub", [INFO] [stdout] 310 + '*' => "imul", [INFO] [stdout] 311 + '/' => "", [INFO] [stdout] 312 + _ => panic!("invalid operand"), [INFO] [stdout] 313 + }, [INFO] [stdout] 314 + _ => panic!("invalid operand"), [INFO] [stdout] 315 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:355:54 [INFO] [stdout] | [INFO] [stdout] 355 | ... Ctype::Char(c) => s.push(c.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*c` [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/lib.rs:411:40 [INFO] [stdout] | [INFO] [stdout] 411 | Addr(_, ref ctype) => Some(&ctype), [INFO] [stdout] | ^^^^^^ help: change this to: `ctype` [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/lib.rs:412:41 [INFO] [stdout] | [INFO] [stdout] 412 | Deref(_, ref ctype) => Some(&ctype), [INFO] [stdout] | ^^^^^^ help: change this to: `ctype` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/lib.rs:420:5 [INFO] [stdout] | [INFO] [stdout] 420 | let types; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `types` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 420 ~ [INFO] [stdout] 421 ~ let types = if a_type > b_type { [INFO] [stdout] 422 ~ (b_type, a_type) [INFO] [stdout] 423 | } else { [INFO] [stdout] 424 ~ (a_type, b_type) [INFO] [stdout] 425 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:438:30 [INFO] [stdout] | [INFO] [stdout] 438 | Int(a) => return Int(a.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*a` [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 `char` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:439:31 [INFO] [stdout] | [INFO] [stdout] 439 | Char(a) => return Int(a.clone() as i32), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*a` [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/lib.rs:440:84 [INFO] [stdout] | [INFO] [stdout] 440 | Array(_, _) => return result_type_int(op, &Ptr(Box::new(types.0.clone())), &types.1), [INFO] [stdout] | ^^^^^^^^ help: change this to: `types.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:508:9 [INFO] [stdout] | [INFO] [stdout] 508 | / return Some(match token { [INFO] [stdout] 509 | | TtypeIdent(sval) => read_ident_or_func(sval), [INFO] [stdout] 510 | | TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] 511 | | TtypeChar(c) => Ast::make_char(c), [INFO] [stdout] 512 | | TtypeString(sval) => Ast::make_string(sval), [INFO] [stdout] 513 | | TtypePunct(punct) => panic!("unexpected character: '{}'", punct), [INFO] [stdout] 514 | | }); [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] 508 ~ Some(match token { [INFO] [stdout] 509 + TtypeIdent(sval) => read_ident_or_func(sval), [INFO] [stdout] 510 + TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] 511 + TtypeChar(c) => Ast::make_char(c), [INFO] [stdout] 512 + TtypeString(sval) => Ast::make_string(sval), [INFO] [stdout] 513 + TtypePunct(punct) => panic!("unexpected character: '{}'", punct), [INFO] [stdout] 514 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:516:9 [INFO] [stdout] | [INFO] [stdout] 516 | 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] 516 - return None; [INFO] [stdout] 516 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/lib.rs:510:45 [INFO] [stdout] | [INFO] [stdout] 510 | TtypeInt(ival) => Ast::make_int(ival as i32), [INFO] [stdout] | ^^^^^^^^^^^ help: try: `ival` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lib.rs:622:13 [INFO] [stdout] | [INFO] [stdout] 622 | fn quote(q: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 622 - fn quote(q: &String) -> String { [INFO] [stdout] 622 + fn quote(q: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/lib.rs:626:13 [INFO] [stdout] | [INFO] [stdout] 626 | buf.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `buf.push('\\')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:639:5 [INFO] [stdout] | [INFO] [stdout] 639 | print!("\t.data\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 639 - print!("\t.data\n"); [INFO] [stdout] 639 + println!("\t.data"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 642 - print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] 642 + println!(".string \"{}\"", quote(&p)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:642:42 [INFO] [stdout] | [INFO] [stdout] 642 | print!(".string \"{}\"\n", quote(&p)); [INFO] [stdout] | ^^ help: change this to: `p` [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: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:172:13 [INFO] [stdout] | [INFO] [stdout] 172 | if !UNGOTTEN.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lex.rs:173:23 [INFO] [stdout] | [INFO] [stdout] 173 | let tok = UNGOTTEN.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.66s [INFO] running `Command { std: "docker" "inspect" "a0e01314980f0dbfbe97503c0e9336a5996af9f0f96e9a95ac6ceaa43229f843", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a0e01314980f0dbfbe97503c0e9336a5996af9f0f96e9a95ac6ceaa43229f843", kill_on_drop: false }` [INFO] [stdout] a0e01314980f0dbfbe97503c0e9336a5996af9f0f96e9a95ac6ceaa43229f843