move of packed fields might or might not occur when they actually are sufficiently aligned

This commit is contained in:
Ralf Jung 2019-08-08 10:01:41 +02:00
parent db7c773a6b
commit e82b053f56

View File

@ -188,7 +188,8 @@
//! you do not accidentally use `self`/`this` in a way that is in conflict with pinning.
//!
//! Moreover, if your type is `#[repr(packed)]`, the compiler will automatically
//! move fields around to be able to drop them. As a consequence, you cannot use
//! move fields around to be able to drop them. In a packed struct, it might even do
//! that for fields that happen to be sufficiently aligned. As a consequence, you cannot use
//! pinning with a `#[repr(packed)]` type.
//!
//! # Projections and Structural Pinning