News for hackers. Stuff that matters.
Re:The borrowchecker is what I like the least about Rust by nine_k on Saturday July 19, 2025 @04:35PM (#44619140)
Why, macros that put Arc<Box<T>> everywhere might just be it.
Re:The borrowchecker is what I like the least about Rust by lblume on Saturday July 19, 2025 @05:06PM (#44619405)
Arc<Box<T>> is redundant, for the contents of the Arc are already stored on the heap. You may be thinking of Arc<Mutex<T>> for multithreaded access or Rc<RefCell<T>> for singlethreaded access. Both enable the same "feature" of moving the compile-time borrow checking to runtime (Mutex/RefCell) and using reference-counting instead of direct ownership (Arc/Rc).