[INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] fatal: write error: No space left on device [INFO] [stderr] fatal: fetch-pack: invalid index-pack output [WARN] Retrying crate fetch in 3 seconds (attempt 1) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 2) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 3) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 4) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 5) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 6) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 7) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 8) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 9) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 10) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 11) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 12) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 13) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] [stderr] /workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify: No space left on device [WARN] Retrying crate fetch in 3 seconds (attempt 14) [INFO] cloning repository https://github.com/mxhold/histogramify [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxhold/histogramify" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 318a01d41ff12eaadf7c5e3f4e7c59bf6628693e [INFO] checking mxhold/histogramify against master#ba7e63b63871a429533c189adbfb1d9a6337e000 for pr-135331-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxhold%2Fhistogramify" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/mxhold/histogramify [INFO] finished tweaking git repo https://github.com/mxhold/histogramify [INFO] tweaked toml for git repo https://github.com/mxhold/histogramify written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mxhold/histogramify on toolchain ba7e63b63871a429533c189adbfb1d9a6337e000 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+ba7e63b63871a429533c189adbfb1d9a6337e000" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/mxhold/histogramify 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" "+ba7e63b63871a429533c189adbfb1d9a6337e000" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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:cf8efcab8866f2cf4285301c7418e2f4f2a9b088c91ba69c40d5b659f81557f7" "/opt/rustwide/cargo-home/bin/cargo" "+ba7e63b63871a429533c189adbfb1d9a6337e000" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 571f760b9c4ef428869bc5e05a92d0cd59334d3403a5f791b6e4b39ea432985d [INFO] running `Command { std: "docker" "start" "-a" "571f760b9c4ef428869bc5e05a92d0cd59334d3403a5f791b6e4b39ea432985d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "571f760b9c4ef428869bc5e05a92d0cd59334d3403a5f791b6e4b39ea432985d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "571f760b9c4ef428869bc5e05a92d0cd59334d3403a5f791b6e4b39ea432985d", kill_on_drop: false }` [INFO] [stdout] 571f760b9c4ef428869bc5e05a92d0cd59334d3403a5f791b6e4b39ea432985d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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:cf8efcab8866f2cf4285301c7418e2f4f2a9b088c91ba69c40d5b659f81557f7" "/opt/rustwide/cargo-home/bin/cargo" "+ba7e63b63871a429533c189adbfb1d9a6337e000" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 3346e75d1e79a7c261668ca3050b8c17c1fde4473f7ee932b21720001771ffd7 [INFO] running `Command { std: "docker" "start" "-a" "3346e75d1e79a7c261668ca3050b8c17c1fde4473f7ee932b21720001771ffd7", kill_on_drop: false }` [INFO] [stderr] Checking histogramify v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let mut word_frequencies: Arc>> = Arc::new(Mutex::new(HashMap::new())); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0597]: `words` does not live long enough [INFO] [stdout] --> src/main.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 17 | fn word_frequencies(words: Vec<&str>) -> HashMap<&str, u32> { [INFO] [stdout] | ----- binding `words` declared here [INFO] [stdout] ... [INFO] [stdout] 20 | let words_for_threads = words.chunks(words.len() / THREADS as usize); [INFO] [stdout] | ^^^^^ borrowed value does not live long enough [INFO] [stdout] ... [INFO] [stdout] 23 | let handle = thread::spawn(move || { [INFO] [stdout] | ______________________- [INFO] [stdout] 24 | | for word in words { [INFO] [stdout] 25 | | word_frequencies [INFO] [stdout] 26 | | .lock() [INFO] [stdout] ... | [INFO] [stdout] 32 | | }); [INFO] [stdout] | |__________- argument requires that `words` is borrowed for `'static` [INFO] [stdout] ... [INFO] [stdout] 41 | } [INFO] [stdout] | - `words` dropped here while still borrowed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0521]: borrowed data escapes outside of function [INFO] [stdout] --> src/main.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 17 | fn word_frequencies(words: Vec<&str>) -> HashMap<&str, u32> { [INFO] [stdout] | ----- - let's call the lifetime of this reference `'1` [INFO] [stdout] | | [INFO] [stdout] | `words` is a reference that is only valid in the function body [INFO] [stdout] ... [INFO] [stdout] 23 | let handle = thread::spawn(move || { [INFO] [stdout] | ______________________^ [INFO] [stdout] 24 | | for word in words { [INFO] [stdout] 25 | | word_frequencies [INFO] [stdout] 26 | | .lock() [INFO] [stdout] ... | [INFO] [stdout] 32 | | }); [INFO] [stdout] | | ^ [INFO] [stdout] | | | [INFO] [stdout] | |__________`words` escapes the function body here [INFO] [stdout] | argument requires that `'1` must outlive `'static` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of dereference of `std::sync::MutexGuard<'_, HashMap<&str, u32>>` [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | *word_frequencies.lock().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `HashMap<&str, u32>`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] help: consider cloning the value if the performance cost is acceptable [INFO] [stdout] | [INFO] [stdout] 40 - *word_frequencies.lock().unwrap() [INFO] [stdout] 40 + word_frequencies.lock().unwrap().clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0597]: `word_frequencies` does not live long enough [INFO] [stdout] --> src/main.rs:40:6 [INFO] [stdout] | [INFO] [stdout] 18 | let mut word_frequencies: Arc>> = Arc::new(Mutex::new(HashMap::new())); [INFO] [stdout] | -------------------- binding `word_frequencies` declared here [INFO] [stdout] ... [INFO] [stdout] 40 | *word_frequencies.lock().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^---------------- [INFO] [stdout] | | [INFO] [stdout] | borrowed value does not live long enough [INFO] [stdout] | a temporary with access to the borrow is created here ... [INFO] [stdout] 41 | } [INFO] [stdout] | - [INFO] [stdout] | | [INFO] [stdout] | `word_frequencies` dropped here while still borrowed [INFO] [stdout] | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `std::sync::MutexGuard` [INFO] [stdout] | [INFO] [stdout] = note: the temporary is part of an expression at the end of a block; [INFO] [stdout] consider forcing this temporary to be dropped sooner, before the block's local variables are dropped [INFO] [stdout] help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block [INFO] [stdout] | [INFO] [stdout] 40 | let x = *word_frequencies.lock().unwrap(); x [INFO] [stdout] | +++++++ +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let mut word_frequencies: Arc>> = Arc::new(Mutex::new(HashMap::new())); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0597]: `words` does not live long enough [INFO] [stdout] --> src/main.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 17 | fn word_frequencies(words: Vec<&str>) -> HashMap<&str, u32> { [INFO] [stdout] | ----- binding `words` declared here [INFO] [stdout] ... [INFO] [stdout] 20 | let words_for_threads = words.chunks(words.len() / THREADS as usize); [INFO] [stdout] | ^^^^^ borrowed value does not live long enough [INFO] [stdout] ... [INFO] [stdout] 23 | let handle = thread::spawn(move || { [INFO] [stdout] | ______________________- [INFO] [stdout] 24 | | for word in words { [INFO] [stdout] 25 | | word_frequencies [INFO] [stdout] 26 | | .lock() [INFO] [stdout] ... | [INFO] [stdout] 32 | | }); [INFO] [stdout] | |__________- argument requires that `words` is borrowed for `'static` [INFO] [stdout] ... [INFO] [stdout] 41 | } [INFO] [stdout] | - `words` dropped here while still borrowed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0507, E0521, E0597. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0507`. [INFO] [stdout] [INFO] [stdout] error[E0521]: borrowed data escapes outside of function [INFO] [stdout] --> src/main.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 17 | fn word_frequencies(words: Vec<&str>) -> HashMap<&str, u32> { [INFO] [stdout] | ----- - let's call the lifetime of this reference `'1` [INFO] [stdout] | | [INFO] [stdout] | `words` is a reference that is only valid in the function body [INFO] [stdout] ... [INFO] [stdout] 23 | let handle = thread::spawn(move || { [INFO] [stdout] | ______________________^ [INFO] [stdout] 24 | | for word in words { [INFO] [stdout] 25 | | word_frequencies [INFO] [stdout] 26 | | .lock() [INFO] [stdout] ... | [INFO] [stdout] 32 | | }); [INFO] [stdout] | | ^ [INFO] [stdout] | | | [INFO] [stdout] | |__________`words` escapes the function body here [INFO] [stdout] | argument requires that `'1` must outlive `'static` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of dereference of `std::sync::MutexGuard<'_, HashMap<&str, u32>>` [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | *word_frequencies.lock().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `HashMap<&str, u32>`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] help: consider cloning the value if the performance cost is acceptable [INFO] [stdout] | [INFO] [stdout] 40 - *word_frequencies.lock().unwrap() [INFO] [stdout] 40 + word_frequencies.lock().unwrap().clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0597]: `word_frequencies` does not live long enough [INFO] [stdout] --> src/main.rs:40:6 [INFO] [stdout] | [INFO] [stdout] 18 | let mut word_frequencies: Arc>> = Arc::new(Mutex::new(HashMap::new())); [INFO] [stdout] | -------------------- binding `word_frequencies` declared here [INFO] [stdout] ... [INFO] [stdout] 40 | *word_frequencies.lock().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^---------------- [INFO] [stdout] | | [INFO] [stdout] | borrowed value does not live long enough [INFO] [stdout] | a temporary with access to the borrow is created here ... [INFO] [stdout] 41 | } [INFO] [stdout] | - [INFO] [stdout] | | [INFO] [stdout] | `word_frequencies` dropped here while still borrowed [INFO] [stdout] | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `std::sync::MutexGuard` [INFO] [stdout] | [INFO] [stdout] = note: the temporary is part of an expression at the end of a block; [INFO] [stdout] consider forcing this temporary to be dropped sooner, before the block's local variables are dropped [INFO] [stdout] help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block [INFO] [stdout] | [INFO] [stdout] 40 | let x = *word_frequencies.lock().unwrap(); x [INFO] [stdout] | +++++++ +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0507, E0521, E0597. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0507`. [INFO] [stdout] [INFO] [stderr] error: could not compile `histogramify` (bin "histogramify" test) due to 4 previous errors; 1 warning emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `histogramify` (bin "histogramify") due to 4 previous errors; 1 warning emitted [INFO] running `Command { std: "docker" "inspect" "3346e75d1e79a7c261668ca3050b8c17c1fde4473f7ee932b21720001771ffd7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3346e75d1e79a7c261668ca3050b8c17c1fde4473f7ee932b21720001771ffd7", kill_on_drop: false }` [INFO] [stdout] 3346e75d1e79a7c261668ca3050b8c17c1fde4473f7ee932b21720001771ffd7