Skip to content

Commit

Permalink
Unrolled build for rust-lang#116894
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#116894 - joshlf:patch-12, r=RalfJung

Guarantee that `char` has the same size and alignment as `u32`
  • Loading branch information
rust-timer authored Nov 4, 2023
2 parents a42d94e + c278bc1 commit 57a5319
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ mod prim_never {}
/// `char` type. For technical reasons, there is additional, separate
/// documentation in [the `std::char` module](char/index.html) as well.
///
/// # Validity
/// # Validity and Layout
///
/// A `char` is a '[Unicode scalar value]', which is any '[Unicode code point]'
/// other than a [surrogate code point]. This has a fixed numerical definition:
Expand Down Expand Up @@ -330,6 +330,13 @@ mod prim_never {}
/// ("noncharacters"); and some may be given different meanings by different
/// users ("private use").
///
/// `char` is guaranteed to have the same size and alignment as `u32` on all
/// platforms.
/// ```
/// use std::alloc::Layout;
/// assert_eq!(Layout::new::<char>(), Layout::new::<u32>());
/// ```
///
/// [Unicode code point]: https://www.unicode.org/glossary/#code_point
/// [Unicode scalar value]: https://www.unicode.org/glossary/#unicode_scalar_value
/// [non-exhaustive match]: ../book/ch06-02-match.html#matches-are-exhaustive
Expand Down

0 comments on commit 57a5319

Please sign in to comment.