Skip to content

Tracking issue for const alloc::Layout #67521

Open

Description

Feature const_alloc_layout makes these methods on Layout const:

  • padding_needed_for
  • for_value
  • for_value_raw
  • pad_to_align
  • array

Making more methods of alloc::Layout const allows computing alignment/size information for arbitrary (sized) types at compile-time. While mem::size_of and mem::align_of are already const and Layout is solely based on those, there is no guarantee that a const derived from these functions will be exactly the same as what is used in a call to alloc::alloc. Constifying Layout makes this possible.

PR #67494, related to #67520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-allocatorsArea: Custom and system allocatorsA-const-fnArea: const fn foo(..) {..}. Pure functions which can be applied at compile time.C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.Libs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions