[INFO] cloning repository https://github.com/tasnuva1/rust-learning [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/tasnuva1/rust-learning" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftasnuva1%2Frust-learning", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftasnuva1%2Frust-learning'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 5d83e408b1b464cd5847f37ba63a89dc477fb822 [INFO] testing tasnuva1/rust-learning against master#cdb45c87e2cd43495379f7e867e3cc15dcee9f93 for pr-145838-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftasnuva1%2Frust-learning" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/tasnuva1/rust-learning [INFO] finished tweaking git repo https://github.com/tasnuva1/rust-learning [INFO] tweaked toml for git repo https://github.com/tasnuva1/rust-learning written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/tasnuva1/rust-learning on toolchain cdb45c87e2cd43495379f7e867e3cc15dcee9f93 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+cdb45c87e2cd43495379f7e867e3cc15dcee9f93" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/tasnuva1/rust-learning 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" "+cdb45c87e2cd43495379f7e867e3cc15dcee9f93" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+cdb45c87e2cd43495379f7e867e3cc15dcee9f93" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 5b33c56c6591d1ef176836caffe4995c85b060f45883fc13618458f08f9a993a [INFO] running `Command { std: "docker" "start" "-a" "5b33c56c6591d1ef176836caffe4995c85b060f45883fc13618458f08f9a993a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "5b33c56c6591d1ef176836caffe4995c85b060f45883fc13618458f08f9a993a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5b33c56c6591d1ef176836caffe4995c85b060f45883fc13618458f08f9a993a", kill_on_drop: false }` [INFO] [stdout] 5b33c56c6591d1ef176836caffe4995c85b060f45883fc13618458f08f9a993a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+cdb45c87e2cd43495379f7e867e3cc15dcee9f93" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 9b52ac5d10b269c75bd64406dca1b55922d1e9ec9d370310a65d7dd12c4865ad [INFO] running `Command { std: "docker" "start" "-a" "9b52ac5d10b269c75bd64406dca1b55922d1e9ec9d370310a65d7dd12c4865ad", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.214 [INFO] [stderr] Compiling serde_json v1.0.132 [INFO] [stderr] Compiling anyhow v1.0.92 [INFO] [stderr] Compiling thiserror v1.0.65 [INFO] [stderr] Compiling bytes v1.8.0 [INFO] [stderr] Compiling syn v2.0.85 [INFO] [stderr] Compiling serde_derive v1.0.214 [INFO] [stderr] Compiling thiserror-impl v1.0.65 [INFO] [stderr] Compiling learning v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] error: an inner attribute is not permitted in this context [INFO] [stdout] --> src/rust_by_examples.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | #![allow(unreachable_code, unused_labels)] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 57 | [INFO] [stdout] 58 | / fn main() { [INFO] [stdout] 59 | | 'outer: loop { [INFO] [stdout] 60 | | println!("Entered the outer loop"); [INFO] [stdout] ... | [INFO] [stdout] 75 | | println!("Exited the outer loop"); [INFO] [stdout] 76 | | } [INFO] [stdout] | |_- the inner attribute doesn't annotate this function [INFO] [stdout] | [INFO] [stdout] = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files [INFO] [stdout] help: to annotate the function, change the attribute from inner to outer style [INFO] [stdout] | [INFO] [stdout] 56 - #![allow(unreachable_code, unused_labels)] [INFO] [stdout] 56 + #[allow(unreachable_code, unused_labels)] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected item, found keyword `let` [INFO] [stdout] --> src/rust_by_examples.rs:428:1 [INFO] [stdout] | [INFO] [stdout] 428 | let optional = Some(7); [INFO] [stdout] | ^^^ [INFO] [stdout] | | [INFO] [stdout] | `let` cannot be used for global variables [INFO] [stdout] | help: consider using `static` or `const` instead of `let` [INFO] [stdout] | [INFO] [stdout] = note: for a full list of items that can appear in modules, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0425]: cannot find value `writer` in this scope [INFO] [stdout] --> src/note_book.rs:337:27 [INFO] [stdout] | [INFO] [stdout] 337 | serde_json::to_writer(writer, &address); // takes ownership. can not use writer for later writing: writer.write_all(b"\n")?; [INFO] [stdout] | ^^^^^^ not found in this scope [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0425]: cannot find value `writer` in this scope [INFO] [stdout] --> src/note_book.rs:338:33 [INFO] [stdout] | [INFO] [stdout] 338 | serde_json::to_writer(&mut *writer, &address); [INFO] [stdout] | ^^^^^^ not found in this scope [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `bail` [INFO] [stdout] --> src/anyhow.rs:1:22 [INFO] [stdout] | [INFO] [stdout] 1 | use anyhow::{anyhow, bail, Context, Result}; [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: `serde_json::Result` [INFO] [stdout] --> src/note_book.rs:315:9 [INFO] [stdout] | [INFO] [stdout] 315 | use serde_json::Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `TcpStream` [INFO] [stdout] --> src/note_book.rs:377:37 [INFO] [stdout] | [INFO] [stdout] 377 | use std::net::{TcpListener, TcpStream}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0592]: duplicate definitions with name `some` [INFO] [stdout] --> src/note_book.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 149 | fn some(self: &Self) {} // self = interface stucture = Self [INFO] [stdout] | -------------------- other definition for `some` [INFO] [stdout] 150 | fn some(self: &Employee) {} // self = Employee instance = Employee [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `some` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0592]: duplicate definitions with name `some` [INFO] [stdout] --> src/note_book.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 149 | ... fn some(self: &Self) {} // self = interface stucture = Self [INFO] [stdout] | -------------------- other definition for `some` [INFO] [stdout] ... [INFO] [stdout] 152 | ... fn some(&self) {} // self = instance //*** any trait fn it has access to instance to operate on it. it will invoke like this: some(... [INFO] [stdout] | ^^^^^^^^^^^^^^ duplicate definitions for `some` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0277]: `Employee` doesn't implement `Debug` [INFO] [stdout] --> src/note_book.rs:144:22 [INFO] [stdout] | [INFO] [stdout] 144 | println!("{:?}", emp_1); [INFO] [stdout] | ---- ^^^^^ `Employee` cannot be formatted using `{:?}` because it doesn't implement `Debug` [INFO] [stdout] | | [INFO] [stdout] | required by this formatting parameter [INFO] [stdout] | [INFO] [stdout] = help: the trait `Debug` is not implemented for `Employee` [INFO] [stdout] = note: add `#[derive(Debug)]` to `Employee` or manually `impl Debug for Employee` [INFO] [stdout] = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: consider annotating `Employee` with `#[derive(Debug)]` [INFO] [stdout] | [INFO] [stdout] 115 + #[derive(Debug)] [INFO] [stdout] 116 | struct Employee { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [INFO] [stdout] --> src/note_book.rs:382:49 [INFO] [stdout] | [INFO] [stdout] 349 | fn typed_example() { [INFO] [stdout] | ------------------ this function should return `Result` or `Option` to accept `?` [INFO] [stdout] ... [INFO] [stdout] 382 | let p = Person::deserialize(&mut de)?; [INFO] [stdout] | ^ cannot use the `?` operator in a function that returns `()` [INFO] [stdout] | [INFO] [stdout] help: consider adding return type [INFO] [stdout] | [INFO] [stdout] 349 | fn typed_example() -> Result<(), Box> { [INFO] [stdout] | +++++++++++++++++++++++++++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/note_book.rs:383:13 [INFO] [stdout] | [INFO] [stdout] 383 | Ok(p) [INFO] [stdout] | ^^^^^ expected `()`, found `Result` [INFO] [stdout] | [INFO] [stdout] = note: expected unit type `()` [INFO] [stdout] found enum `Result` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `content` [INFO] [stdout] --> src/anyhow.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let content = std::fs::read("filename.txt").context("Failed to detach the important thing")?; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_content` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `content` [INFO] [stdout] --> src/anyhow.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let content = [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_content` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0004]: non-exhaustive patterns: `Some(&DataStoreError::InvalidHeader { .. })` and `Some(&DataStoreError::OutOfBounds { .. })` not covered [INFO] [stdout] --> src/anyhow.rs:43:25 [INFO] [stdout] | [INFO] [stdout] 43 | Err(e) => match e.downcast_ref() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ patterns `Some(&DataStoreError::InvalidHeader { .. })` and `Some(&DataStoreError::OutOfBounds { .. })` not covered [INFO] [stdout] | [INFO] [stdout] note: `std::option::Option<&DataStoreError>` defined here [INFO] [stdout] --> /rustc/cdb45c87e2cd43495379f7e867e3cc15dcee9f93/library/core/src/option.rs:593:1 [INFO] [stdout] ::: /rustc/cdb45c87e2cd43495379f7e867e3cc15dcee9f93/library/core/src/option.rs:601:5 [INFO] [stdout] | [INFO] [stdout] = note: not covered [INFO] [stdout] = note: the matched value is of type `std::option::Option<&DataStoreError>` [INFO] [stdout] help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms [INFO] [stdout] | [INFO] [stdout] 47 ~ None => (), [INFO] [stdout] 48 ~ Some(&DataStoreError::InvalidHeader { .. }) | Some(&DataStoreError::OutOfBounds { .. }) => todo!(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `e` [INFO] [stdout] --> src/anyhow.rs:137:31 [INFO] [stdout] | [INFO] [stdout] 137 | assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `e` [INFO] [stdout] --> src/anyhow.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/note_book.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | let mut some_text = stringable_stucture.to_uppercase(); // it's the refence pointer which is auto derefernced [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: unused variable: `e` [INFO] [stdout] --> src/note_book.rs:125:23 [INFO] [stdout] | [INFO] [stdout] 125 | fn emp_cal_handle(e: Employee) {} // doesn't imp copy trait, it move ownership [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `e` [INFO] [stdout] --> src/note_book.rs:128:15 [INFO] [stdout] | [INFO] [stdout] 128 | fn bonase(e: &mut Employee) -> Employee { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `size` [INFO] [stdout] --> src/note_book.rs:225:13 [INFO] [stdout] | [INFO] [stdout] 225 | let size = std::mem::size_of::(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_size` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr` [INFO] [stdout] --> src/note_book.rs:223:21 [INFO] [stdout] | [INFO] [stdout] 223 | fn any_array(arr: &[T]) { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_arr` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0004, E0277, E0308, E0425, E0592. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0004`. [INFO] [stdout] [INFO] [stderr] error: could not compile `learning` (bin "learning") due to 10 previous errors; 12 warnings emitted [INFO] running `Command { std: "docker" "inspect" "9b52ac5d10b269c75bd64406dca1b55922d1e9ec9d370310a65d7dd12c4865ad", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9b52ac5d10b269c75bd64406dca1b55922d1e9ec9d370310a65d7dd12c4865ad", kill_on_drop: false }` [INFO] [stdout] 9b52ac5d10b269c75bd64406dca1b55922d1e9ec9d370310a65d7dd12c4865ad