From 179dc7d8e906784b38ecc481136243f61ae8ffe4 Mon Sep 17 00:00:00 2001 From: Tiger0202 Date: Wed, 14 Jun 2023 08:49:57 +0300 Subject: [PATCH] Remove note about soundness hole in type-layout.md Issue https://github.com/rust-lang/rust/issues/27060 has been resolved, so it is no longer possible to safely create unaligned pointers to packed struct fields. --- src/type-layout.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/type-layout.md b/src/type-layout.md index 191567a..9ecb784 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -549,13 +549,7 @@ The `align` modifier can also be applied on an `enum`. When it is, the effect on the `enum`'s alignment is the same as if the `enum` was wrapped in a newtype `struct` with the same `align` modifier. -
- -***Warning:*** Dereferencing an unaligned pointer is [undefined behavior] and -it is possible to [safely create unaligned pointers to `packed` fields][27060]. -Like all ways to create undefined behavior in safe Rust, this is a bug. - -
+Dereferencing an unaligned pointer is [undefined behavior]. ### The `transparent` Representation