Closed
Description
When using Self
to create an enum variant in Rust 1.37+, we get an error:
const VAL: Self = Self::X(42);
results in:
error: `Foo::X` is not yet stable as a const fn
but if the enum is constructed explicitly, the compilation succeeds:
const VAL: Self = Foo::X(42)
Looking at #53555, it looks like Self::EnumVariant
should be considered a const fn
with min_const_fn
.
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Messages for errors, warnings, and lintsCategory: A feature request, i.e: not implemented / a PR.Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.