Skip to content

Reevaluate Miri engine alignment checks #63085

Closed
@RalfJung

Description

@RalfJung

Two PRs will likely land soon that change the way the Miri engine does alignment checks: #63079 and #63075.

The former entirely disables alignment checks for CTFE (when the Miri engine is used as part of compilation). The latter moves the checking of "access validity" of a pointer (non-dangling and aligned) to the moment the pointer is dereferenced (using the * operator), as opposed to doing the checks only when a load/store actually happens.

As a consequence, the align field of MemPlace is now effectively dead weight in both instances of the Miri engine. However, Miri might need it again in the future if we decide to relax the rules for dereferencing pointers, which is a discussion I want to have after rust-lang/rfcs#2582. Then we should either remove the align field for good, or try to abstract it through the Machine trait so that CTFE does not have to carry it. Also see #63079 (comment).

Cc @oli-obk

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-miriArea: The miri toolT-compilerRelevant to the compiler 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