This PR makes ConcurrentQueue::unbounded a const function. It'd be great if bounded could be const as well, but this would likely require static memory allocation support in const functions, which is currently not allowed by the compiler. This would enable https://github.com/smol-rs/async-executor/pull/112 to be directly constructable in a const context (i.e. static/thread_local variable initialization without OnceLock). It might also allow unbounded async_channels to be constructed in a similar context.
This PR makes
ConcurrentQueue::unbounded
a const function. It'd be great ifbounded
could beconst
as well, but this would likely require static memory allocation support in const functions, which is currently not allowed by the compiler. This would enable https://github.com/smol-rs/async-executor/pull/112 to be directly constructable in a const context (i.e. static/thread_local variable initialization without OnceLock). It might also allow unboundedasync_channel
s to be constructed in a similar context.