rustc 1.67.0 (fc594f156 2023-01-24) (built from a source tarball) $ rustc --edition=2021 drop_order.rs exit=0 $ ./drop_order exit=0 inside block drop second worker done drop first main done $ rustc --edition=2021 scoped_borrow.rs exit=0 $ ./scoped_borrow exit=0 worker read: resize:photo-1 main still owns 1 jobs $ rustc --edition=2021 rc_thread.rs exit=1 error[E0277]: `Rc` cannot be sent between threads safely --> work/site-renewal/blog/experiments/rust-ownership/rc_thread.rs:6:19 | 6 | thread::spawn(move || println!("{}", shared.len())).join().unwrap(); | ------------- -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | | | `Rc` cannot be sent between threads safely | | within this `[closure@work/site-renewal/blog/experiments/rust-ownership/rc_thread.rs:6:19: 6:26]` | required by a bound introduced by this call | = help: within `[closure@work/site-renewal/blog/experiments/rust-ownership/rc_thread.rs:6:19: 6:26]`, the trait `Send` is not implemented for `Rc` note: required because it's used within this closure --> work/site-renewal/blog/experiments/rust-ownership/rc_thread.rs:6:19 | 6 | thread::spawn(move || println!("{}", shared.len())).join().unwrap(); | ^^^^^^^ note: required by a bound in `spawn` --> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_rust/rust/work/rustc-1.67.0-src/library/std/src/thread/mod.rs:704:8 | = note: required by this bound in `spawn` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. $ rustc --edition=2021 arc_queue.rs exit=0 $ ./arc_queue exit=0 lengths: [Some(14), Some(14)] remaining: 0 $ rustc --edition=2021 panic_after_pop.rs exit=0 $ ./panic_after_pop exit=0 stdout: popped: resize:photo-1 join failed: true remaining: 0 stderr: thread '' panicked at 'simulated processing failure', work/site-renewal/blog/experiments/rust-ownership/panic_after_pop.rs:10:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace $ rustc --edition=2021 arc_refcell_thread.rs exit=1 error[E0277]: `RefCell>` cannot be shared between threads safely --> work/site-renewal/blog/experiments/rust-ownership/arc_refcell_thread.rs:8:19 | 8 | thread::spawn(move || other.borrow_mut().pop_front()).join().unwrap(); | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `RefCell>` cannot be shared between threads safely | | | required by a bound introduced by this call | = help: the trait `Sync` is not implemented for `RefCell>` = note: required for `Arc>>` to implement `Send` note: required because it's used within this closure --> work/site-renewal/blog/experiments/rust-ownership/arc_refcell_thread.rs:8:19 | 8 | thread::spawn(move || other.borrow_mut().pop_front()).join().unwrap(); | ^^^^^^^ note: required by a bound in `spawn` --> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_rust/rust/work/rustc-1.67.0-src/library/std/src/thread/mod.rs:704:8 | = note: required by this bound in `spawn` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. $ rustc --edition=2021 panic_while_locked.rs exit=0 $ ./panic_while_locked exit=0 stdout: popped: job join failed: true poisoned: true remaining: 0 stderr: thread '' panicked at 'simulated failure while holding lock', work/site-renewal/blog/experiments/rust-ownership/panic_while_locked.rs:11:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace