From 1c8095bc902b7dfcfc514b94e935a4c6675ff550 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Tue, 29 Jul 2025 14:51:26 +0000 Subject: [PATCH] Clarify layout of tuples when last field is unsized --- src/type-layout.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/type-layout.md b/src/type-layout.md index db43a87394..9d43858060 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -91,7 +91,9 @@ r[layout.tuple] ## Tuple layout r[layout.tuple.def] -Tuples are laid out according to the [`Rust` representation][`Rust`]. +Tuples are laid out according to the same rules as structs using the [`Rust` representation][`Rust`]. + +They are laid out like a struct without generic parameters. This means that the last field of the tuple is not guaranteed to be stored at the end. r[layout.tuple.unit] The exception to this is the unit tuple (`()`), which is guaranteed as a [zero-sized type] to have a size of 0 and an alignment of 1.