|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, to maintain API compatibility, `replace` needs to be a
regular borrow, so we need interior mutability with
`UnsafeCell`. Simultaneously, `HandlerArray` needs to be `const fn` so
it can be used where `lazy_static` isn't available, which means it
needs to initialize its array in one go without the help of
`MaybeUninit`. To do that, `Handler` must be `Copy`, but since it
contains an `UnsafeCell` now, it cannot be copy.
And thus we are boned. There are times when I think the premise of
rust is admirable, but implementation is impossible.
|