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.
Playground links for both variants: error, no-error
When using
Selfto create an enum variant in Rust 1.37+, we get an error:results in:
but if the enum is constructed explicitly, the compilation succeeds:
Looking at #53555, it looks like
Self::EnumVariantshould be considered aconst fnwithmin_const_fn.Playground links for both variants: error, no-error