≈ the.bay.news

Feature Request: Use Arc in constants

Rust Internals
Feature Request: Use Arc in constants
Consider the following situation: static GLOBAL: Mutex<Arc<Vec>> = Mutex::new( ... ) Programmers can't make this happen now, as there's no way to construct an Arc in constants with compile-time evaluation. We can make the Arc point to somewhere on static memories with the strong ref counter set to 2 so Arc won't accidentally release memories on static segments if dropped. Since Arc is now available in constants, other APIs in Arc can be const fn as well.

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.