From f1d214fa5c26b3bc4fd236d51186aeeb45126b59 Mon Sep 17 00:00:00 2001 From: zyl Date: Thu, 29 Feb 2024 16:47:08 +0800 Subject: [PATCH] Update behavior-considered-undefined.md --- src/behavior-considered-undefined.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/behavior-considered-undefined.md b/src/behavior-considered-undefined.md index 756b86db0..8f004c23c 100644 --- a/src/behavior-considered-undefined.md +++ b/src/behavior-considered-undefined.md @@ -119,7 +119,7 @@ omitted in surface Rust syntax due to automatic dereferencing; we are considering the fully expanded place expression here.) For instance, if `ptr` has type `*const S` where `S` has an alignment of 8, then -`ptr` must be 8-aligned or else `(*ptr).f` is "based on an misaligned pointer". +`*ptr` must be 8-aligned or else `(*ptr).f` is "based on an misaligned pointer". This is true even if the type of the field `f` is `u8` (i.e., a type with alignment 1). In other words, the alignment requirement derives from the type of the pointer that was dereferenced, *not* the type of the field that is being