]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-enum-variants/no-type-application-on-aliased-enum-variant.rs
Rollup merge of #101040 - danielhenrymantilla:no-bounds-for-default-annotated-derive...
[rust.git] / src / test / ui / type-alias-enum-variants / no-type-application-on-aliased-enum-variant.rs
1 // Check that a generic type for an `enum` admits type application
2 // on both the type constructor and the generic type's variant.
3 //
4 // Also check that a type alias to said generic type admits type application
5 // on the type constructor but *NOT* the variant.
6
7 type Alias<T> = Option<T>;
8
9 fn main() {
10     let _ = Option::<u8>::None; // OK
11     let _ = Option::None::<u8>; // OK (Lint in future!)
12     let _ = Alias::<u8>::None; // OK
13     let _ = Alias::None::<u8>; //~ ERROR type arguments are not allowed on this type
14 }