File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/test/ui/type-alias-enum-variants Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 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+
17type Alias < T > = Option < T > ;
28
39fn main ( ) {
410 let _ = Option :: < u8 > :: None ; // OK
511 let _ = Option :: None :: < u8 > ; // OK (Lint in future!)
612 let _ = Alias :: < u8 > :: None ; // OK
7- let _ = Alias :: None :: < u8 > ; // Error
8- //~^ type arguments are not allowed for this type
13+ let _ = Alias :: None :: < u8 > ; //~ ERROR type arguments are not allowed for this type
914}
Original file line number Diff line number Diff line change 11error[E0109]: type arguments are not allowed for this type
2- --> $DIR/type-alias-enum-variants.rs:7 :27
2+ --> $DIR/type-alias-enum-variants.rs:13 :27
33 |
4- LL | let _ = Alias::None::<u8>; // Error
4+ LL | let _ = Alias::None::<u8>;
55 | ^^ type argument not allowed
66
77error: aborting due to previous error
You can’t perform that action at this time.
0 commit comments