File: issue-7364.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (26 lines) | stat: -rw-r--r-- 1,323 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error[E0277]: `RefCell<isize>` cannot be shared between threads safely
  --> $DIR/issue-7364.rs:4:15
   |
LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
   |               ^^^^^^^^^^^^^^^^^^^ `RefCell<isize>` cannot be shared between threads safely
   |
   = help: the trait `Sync` is not implemented for `RefCell<isize>`
   = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
   = note: required for `Unique<RefCell<isize>>` to implement `Sync`
note: required because it appears within the type `Box<RefCell<isize>>`
  --> $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 associated function `Box::<RefCell<isize>>::new` in statics
  --> $DIR/issue-7364.rs:4:37
   |
LL | static boxed: Box<RefCell<isize>> = 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 `std::sync::LazyLock::new(|| ...)`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0015, E0277.
For more information about an error, try `rustc --explain E0015`.