Skip to content

Closures in enum discriminants error when they shouldn't #50689

Closed
@leoyvens

Description

@leoyvens

This used to work (regression from 1.14 stable) but now it doesn't:

enum Functions {
    Square = (|x:i32| { }, 42).1,
}

In #50623 the error less bad and some FIXME(#50689) are left in the code with hints, but still doesn't work. Issue #50688 seems related.

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-type-systemArea: Type systemP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions