Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3fea7cc

Browse files
authored
Guarantee that char has the same size and alignment as u32
1 parent e1de04a commit 3fea7cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/core/src/primitive_docs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ mod prim_never {}
283283
/// `char` type. For technical reasons, there is additional, separate
284284
/// documentation in [the `std::char` module](char/index.html) as well.
285285
///
286-
/// # Validity
286+
/// # Validity and Layout
287287
///
288288
/// A `char` is a '[Unicode scalar value]', which is any '[Unicode code point]'
289289
/// other than a [surrogate code point]. This has a fixed numerical definition:
@@ -330,6 +330,9 @@ mod prim_never {}
330330
/// ("noncharacters"); and some may be given different meanings by different
331331
/// users ("private use").
332332
///
333+
/// `char` is guaranteed to have the same size and alignment as `u32` on all
334+
/// platforms.
335+
///
333336
/// [Unicode code point]: https://www.unicode.org/glossary/#code_point
334337
/// [Unicode scalar value]: https://www.unicode.org/glossary/#unicode_scalar_value
335338
/// [non-exhaustive match]: ../book/ch06-02-match.html#matches-are-exhaustive

0 commit comments

Comments
 (0)