regression: RefCell<LineWriter<std::io::stdio::StdoutRaw>> cannot be shared between threads safely · Issue #127340 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@Mark-Simulacrum

Description

@Mark-Simulacrum

The error seems probably correct, but it's not clear why this would have started failing now.

[INFO] [stdout] error[E0277]: `RefCell<LineWriter<std::io::stdio::StdoutRaw>>` cannot be shared between threads safely
[INFO] [stdout]    --> src/lib.rs:205:20
[INFO] [stdout]     |
[INFO] [stdout] 205 |                 Ok(Box::new(stdout))
[INFO] [stdout]     |                    ^^^^^^^^^^^^^^^^ `RefCell<LineWriter<std::io::stdio::StdoutRaw>>` cannot be shared between threads safely
[INFO] [stdout]     |
[INFO] [stdout]     = help: the trait `Sync` is not implemented for `RefCell<LineWriter<std::io::stdio::StdoutRaw>>`, which is required by `StdoutLock<'_>: Sync`
[INFO] [stdout]     = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
[INFO] [stdout]     = note: required for `ReentrantLockGuard<'_, RefCell<LineWriter<std::io::stdio::StdoutRaw>>>` to implement `Sync`
[INFO] [stdout] note: required because it appears within the type `StdoutLock<'_>`
[INFO] [stdout]    --> /rustc/64a1fe67112931359c7c9a222f08fd206255c2b5/library/std/src/io/stdio.rs:614:12
[INFO] [stdout]     = note: required for the cast from `Box<StdoutLock<'_>>` to `Box<dyn std::io::Write + Sync>`