API to acquire arbitrarily initialized buffer?

Oh, I somehow missed that a: u8 here. So in generic code I could not even enter the first case.

Basically, to use Rust terminology, you are suggesting to add a coercion from mu8 to u8 that performs a freeze. Sorry for misunderstanding.

In that case I do not see a reason for why that should be an implicit coercion, we might as well do

type mu8 = MaybeUninit<u8>;

impl mu8 {
  fn freeze(self) -> u8 { /* ... */ }
}

I do not think saving 9 characters for some very specific unsafe code is worth the extra coercion, and also this is a subtle operation that really should be performed explicitly rather than implicitly.

8 Likes