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
+
1
7
type Alias < T > = Option < T > ;
2
8
3
9
fn main ( ) {
4
10
let _ = Option :: < u8 > :: None ; // OK
5
11
let _ = Option :: None :: < u8 > ; // OK (Lint in future!)
6
12
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
9
14
}
Original file line number Diff line number Diff line change 1
1
error[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
3
3
|
4
- LL | let _ = Alias::None::<u8>; // Error
4
+ LL | let _ = Alias::None::<u8>;
5
5
| ^^ type argument not allowed
6
6
7
7
error: aborting due to previous error
You can’t perform that action at this time.
0 commit comments