Skip to content

Gather CTFE support code in const_eval and cleanup that file #67316

Closed
@RalfJung

Description

@RalfJung

Follow-up to #66866: @oli-obk agreed to move eval_const_fn_call to const_eval.rs. Generally I propose that interp should not contain code that is only needed by CTFE. We have intern.rs and snapshot.rs in there are they need some very deep access to Miri engine internals, but at least those are separate modules.

Also, const_eval.rs has grown pretty messy, and it does not seem like the order of definitions in that file follows any principle. We could split the file into two similar to what I did with Miri: const_eval/engine.rs for implementing the machine trait and defining everything that is needed during CTFE execution, and const_eval/eval.rs for defining the setup functions and all the glue that connects CTFE with the rest of the compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-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