Skip to content

Commit 8128316

Browse files
committed
Document that libcore relies on this guarantee
1 parent 28673da commit 8128316

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reference/src/layout/scalars.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ range of values that the pointer-holding integer types must support:
6969
* `intptr_t`: `[INTPTR_MIN, INTPTR_MAX] = [-(2^15 - 1), 2^15 - 1]`
7070
* `uintptr_t`: `[0, UINTPTR_MAX] = [0, 2^16 - 1]`
7171

72-
That is, `isize`/`usize` are at least 16-bit wide.
72+
That is, `isize`/`usize` are at least 16-bit wide. `libcore` relies on
73+
this guarantee and unconditionally provides:
74+
75+
* `impl From<i16> for isize`,
76+
* `impl From<u16> for usize`.
7377

7478
</details>
7579

0 commit comments

Comments
 (0)