From ebec675bd6ceabede28895f2e3113751a08355e4 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Wed, 4 Mar 2026 12:13:01 -0500 Subject: [PATCH 1/2] [type layout] Clarify size and alignment of pointers to unsized types --- src/type-layout.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/type-layout.md b/src/type-layout.md index 28daeef450..d6aec8b377 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -58,7 +58,7 @@ r[layout.pointer.thin] Pointers to sized types have the same size and alignment as `usize`. r[layout.pointer.unsized] -Pointers to unsized types are sized. The size and alignment is guaranteed to be at least equal to the size and alignment of a pointer. +Pointers to unsized types are sized. The size and alignment of a pointer to an unsized type are guaranteed to be greater than or equal to the size and alignment of a pointer to a sized type. > [!NOTE] > Though you should not rely on this, all pointers to DSTs are currently twice the size of the size of `usize` and have the same alignment. From 06e4a0105158a42509ee0643b08bef476fc9d39a Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 10 Mar 2026 18:04:57 +0000 Subject: [PATCH 2/2] Improve wording on `layout.pointer.unsized` Changing this sentence to use "are", as this PR does, is correct. But it's clear too why the original had said "is", as with the change it reads a bit awkwardly. Adding the work "each" corrects this, so let's do that. --- src/type-layout.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/type-layout.md b/src/type-layout.md index d6aec8b377..0eb90c2e21 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -58,7 +58,7 @@ r[layout.pointer.thin] Pointers to sized types have the same size and alignment as `usize`. r[layout.pointer.unsized] -Pointers to unsized types are sized. The size and alignment of a pointer to an unsized type are guaranteed to be greater than or equal to the size and alignment of a pointer to a sized type. +Pointers to unsized types are sized. The size and alignment of a pointer to an unsized type are each guaranteed to be greater than or equal to those of a pointer to a sized type. > [!NOTE] > Though you should not rely on this, all pointers to DSTs are currently twice the size of the size of `usize` and have the same alignment.