Skip to content

Commit 34818be

Browse files
Add note about safety in documentation
Co-Authored-By: Michael Schmidt <[email protected]>
1 parent 3af8194 commit 34818be

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: guide/src/reference/types/boxed-number-slices.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
from the Wasm linear memory when returning a boxed slice to JavaScript, and vice
99
versa when receiving a JavaScript `TypedArray` as a boxed slice in Rust.
1010

11+
> **Note:** Numeric `MaybeUninit<T>` can always be assumed to be initialized
12+
> upon transmission from Rust to JS and vice-versa. However, uninitialized
13+
> values coming from Rust might contain unspecified values.
14+
1115
## Example Rust Usage
1216

1317
```rust

Diff for: guide/src/reference/types/number-slices.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
55
| No | Yes | Yes | No | No | No | A JavaScript `TypedArray` view of the Wasm memory for the boxed slice of the appropriate type (`Int32Array`, `Uint8Array`, etc) |
66

7+
> **Note:** Numeric `MaybeUninit<T>` can always be assumed to be initialized
8+
> upon transmission from Rust to JS and vice-versa. However, uninitialized
9+
> values coming from Rust might contain unspecified values.
10+
711
## Example Rust Usage
812

913
```rust

0 commit comments

Comments
 (0)