Skip to content

Cast and Coercion enums duplicate a lot of structure #59588

Closed
@oli-obk

Description

@oli-obk

The Adjust enum in src/librustc/ty/adjustment.rs and the CastKind enum in src/librustc/mir/mod.rs have all fields but one of the CastKind enum in common. We should pull them out into a single enum that both use. Additionally this will allow merging some variants of ExprKind in src/librustc_mir/hair/mod.rs by having a single Coerce variant that has a field of the newly created enum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coercionsArea: implicit and explicit `expr as Type` coercionsC-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