Cleanup type-alias-enum-variants.rs test.

This commit is contained in:
Mazdak Farrokhzad 2019-06-09 02:57:50 +02:00
parent 0d27995b0d
commit 86422582df
2 changed files with 9 additions and 4 deletions

View File

@ -1,9 +1,14 @@
// Check that a generic type for an `enum` admits type application
// on both the type constructor and the generic type's variant.
//
// Also check that a type alias to said generic type admits type application
// on the type constructor but *NOT* the variant.
type Alias<T> = Option<T>;
fn main() {
let _ = Option::<u8>::None; // OK
let _ = Option::None::<u8>; // OK (Lint in future!)
let _ = Alias::<u8>::None; // OK
let _ = Alias::None::<u8>; // Error
//~^ type arguments are not allowed for this type
let _ = Alias::None::<u8>; //~ ERROR type arguments are not allowed for this type
}

View File

@ -1,7 +1,7 @@
error[E0109]: type arguments are not allowed for this type
--> $DIR/type-alias-enum-variants.rs:7:27
--> $DIR/type-alias-enum-variants.rs:13:27
|
LL | let _ = Alias::None::<u8>; // Error
LL | let _ = Alias::None::<u8>;
| ^^ type argument not allowed
error: aborting due to previous error