error[E0277]: `RefCell` cannot be shared between threads safely --> $DIR/issue-7364.rs:4:15 | LL | static boxed: Box> = Box::new(RefCell::new(0)); | ^^^^^^^^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `RefCell`, which is required by `Box>: Sync` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Unique>` to implement `Sync` note: required because it appears within the type `Box>` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL = note: shared static variables must have a type that implements `Sync` error[E0015]: cannot call non-const fn `Box::>::new` in statics --> $DIR/issue-7364.rs:4:37 | LL | static boxed: Box> = Box::new(RefCell::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell error: aborting due to 2 previous errors Some errors have detailed explanations: E0015, E0277. For more information about an error, try `rustc --explain E0015`.