Skip to content

Cleanup: Share DST size/align computation logic between codegen backends (and interpreter) #103728

Open
@RalfJung

Description

@RalfJung

Currently, each codegen backend and the MIR interpreter needs to re-implement this logic:

pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(

pub(crate) fn size_and_align_of_dst<'tcx>(

pub(super) fn size_and_align_of(

Turns out the interpreter version actually has a bug. Ideally we'd only have this logic once so that we don't need the same subtle logic in multiple places.

Cc @bjorn3 @eddyb

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-craneliftThings relevant to the [future] cranelift backendC-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions