Skip to content

Feature request: pattern types #1028

@N1ark

Description

@N1ark

Was browsing the Rust repo and saw this rust-lang/rust#152569 which seems like it's going to be merged sooner rather than later. "Unfortunately" for us, it means pattern types are going to occur in the code we compile (e.g. with NonNull, NonZero_). Currently they are not handled by hax.

We should thus start translating them, making it easier for clients to uphold the validity invariants of these types without relying on the rather unpleasant rustc_layout_scalar_valid_range_start.

I can look into it when it inevitably becomes needed; from what I understand this only requires adding a TyKind::Pattern(Ty, Pattern) with enum Pattern { Range(ConstExpr, ConstExpr), Or(Vec<Pattern>), NotNull }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions