pin_project_internal::pin_project::derive

Function ensure_not_packed

source
fn ensure_not_packed(
    orig: &OriginalType<'_>,
    fields: Option<&Fields>,
) -> Result<TokenStream>
Expand description

Checks that the [repr(packed)] attribute is not included.

This currently does two checks:

  • Checks the attributes of structs to ensure there is no [repr(packed)].
  • Generates a function that borrows fields without an unsafe block and forbidding unaligned_references lint.