Everywhere else, Enum::Variant::<…> and Enum::<…>::Variant are interchangeable. In both cases the list <…> contains the generic args for the enum. This holds true for unit (E::V), tuple (E::V(…)) and true (braced) struct (E::V {…}) variant constructions.
However, in direct const args (as opposed to AnonConst const args), the Enum::<…>::Variant form is not permitted in unit & tuple constructions forcing you to specify them via Enum::Variant::<…>. Enum::<…>::Variant { … } (true struct construction) works fine on the other hand.
#![feature(min_generic_const_args)]
#![feature(adt_const_params, unsized_const_params)]
#[derive(PartialEq, Eq, std::marker::ConstParamTy)]
enum Enum<T> {
Unit,
Tuple(),
Store(T),
}
// FIXME: Ctor(Variant, Const)
type const _: Enum<()> = Enum::<()>::Unit;
//~^ ERROR type arguments are not allowed on enum `Enum`
//~| ERROR missing generics for enum `Enum`
// FIXME: Ctor(Variant, Fn)
type const _: Enum<()> = Enum::<()>::Tuple();
//~^ ERROR type arguments are not allowed on enum `Enum`
//~| ERROR missing generics for enum `Enum`
// OK: Variant
type const _: Enum<()> = Enum::<()>::Unit {};
type const _: Enum<()> = Enum::Unit::<()>; // OK
type const _: Enum<()> = Enum::Tuple::<()>(); // OK
type const _: Enum<()> = const { Enum::<()>::Unit }; // (OK)
type const _: Enum<()> = const { Enum::<()>::Tuple() }; // (OK)
Everywhere else,
Enum::Variant::<…>andEnum::<…>::Variantare interchangeable. In both cases the list<…>contains the generic args for the enum. This holds true for unit (E::V), tuple (E::V(…)) and true (braced) struct (E::V {…}) variant constructions.However, in direct const args (as opposed to AnonConst const args), the
Enum::<…>::Variantform is not permitted in unit & tuple constructions forcing you to specify them viaEnum::Variant::<…>.Enum::<…>::Variant { … }(true struct construction) works fine on the other hand.