Skip to content

Tracking issue for treating tuple struct and variant constructors as const fn #61456

Closed
@matthewjasper

Description

@matthewjasper

The const_constructor feature allows calling any expression of a tuple-like constructor in a const fn:

const fn make_options() {
    Some(0); // OK on stable
    (Option::Some)(1); // OK on stable
    let f = Option::Some;
    f(2); // Requires feature gate
}

cc @oli-obk @Centril

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language 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