rustc 1.67.0 (fc594f156 2023-01-24) (built from a source tarball) $ rustc --edition=2021 moved_job.rs exit=1 error[E0382]: borrow of moved value: `job` --> work/site-renewal/blog/experiments/rust-ownership/moved_job.rs:6:24 | 4 | let job = String::from("resize:photo-1"); | --- move occurs because `job` has type `String`, which does not implement the `Copy` trait 5 | let worker = thread::spawn(move || job.len()); | ------- --- variable moved due to use in closure | | | value moved into closure here 6 | println!("queued: {job}"); | ^^^ value borrowed here after move | = 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) error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. $ rustc --edition=2021 borrowed_queue.rs exit=1 error[E0502]: cannot borrow `jobs` as mutable because it is also borrowed as immutable --> work/site-renewal/blog/experiments/rust-ownership/borrowed_queue.rs:6:5 | 5 | let next = jobs.front().unwrap(); | ------------ immutable borrow occurs here 6 | jobs.pop_front(); | ^^^^^^^^^^^^^^^^ mutable borrow occurs here 7 | println!("completed: {next}"); | ---- immutable borrow later used here error: aborting due to previous error For more information about this error, try `rustc --explain E0502`. $ rustc --edition=2021 working_queue.rs exit=0 $ ./working_queue exit=0 queued: resize:photo-1 bytes: 14 remaining: 0