`Uint8Array::view_mut_raw` safety requirements seem incorrect.
Uint8Array::view_mut_raw (and all similar array view types) have a safety requirement link that says:
Unsafety Views into WebAssembly memory are only valid so long as the backing buffer isn’t resized in JS. Once this function is called any future calls to Box::new (or malloc of any form) may cause the returned value here to be invalidated. Use with caution!
I believe that this safety comment is incorrect, and should instead be a "correctness" note. When wasm memory is grown (such as by allocation or the memory.grow function), views into wasm memory detach, and report size 0 and throw if anything tries to access any elements. Given this, I don't believe that this is a safety requirement of the function, but is still a useful note for getting correct results.
However, the function does have a safety requirement and that is that it's "morally equivalent" to slice::from_raw_parts_mut in that the memory must be valid for length items, must not be mutated by anything besides the returned value while the returned value exists, etc. This is not currently documented, but should be.
I'm happy to review PRs improving the documentation, though I would have to dig into this to figure out the details here.