rust/src/test/ui/const-generics/invalid-enum.stderr

100 lines
3.5 KiB
Text
Raw Normal View History

2020-08-22 03:32:07 +00:00
error[E0573]: expected type, found variant `CompileFlag::A`
--> $DIR/invalid-enum.rs:21:12
2020-08-22 03:32:07 +00:00
|
LL | test_1::<CompileFlag::A>();
| ^^^^^^^^^^^^^^
| |
| not a type
| help: try using the variant's enum: `CompileFlag`
error[E0573]: expected type, found variant `CompileFlag::A`
--> $DIR/invalid-enum.rs:26:15
|
LL | test_2::<_, CompileFlag::A>(0);
| ^^^^^^^^^^^^^^
| |
| not a type
| help: try using the variant's enum: `CompileFlag`
error[E0573]: expected type, found variant `CompileFlag::A`
--> $DIR/invalid-enum.rs:31:18
|
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^
| |
| not a type
| help: try using the variant's enum: `CompileFlag`
error[E0107]: wrong number of const arguments: expected 1, found 0
--> $DIR/invalid-enum.rs:31:10
|
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
error[E0107]: wrong number of type arguments: expected at most 1, found 2
--> $DIR/invalid-enum.rs:31:34
|
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| ^ unexpected type argument
|
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 };
| ^ ^
error[E0107]: wrong number of const arguments: expected 1, found 0
--> $DIR/invalid-enum.rs:36:10
|
LL | let _: Example<Example::ASSOC_FLAG, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
error[E0107]: wrong number of type arguments: expected at most 1, found 2
--> $DIR/invalid-enum.rs:36:39
|
LL | let _: Example<Example::ASSOC_FLAG, _> = Example { x: 0 };
| ^ unexpected type argument
|
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
LL | let _: Example<{ Example::ASSOC_FLAG }, _> = Example { x: 0 };
| ^ ^
2020-08-22 03:32:07 +00:00
error[E0107]: wrong number of const arguments: expected 1, found 0
--> $DIR/invalid-enum.rs:21:3
2020-08-22 03:32:07 +00:00
|
LL | test_1::<CompileFlag::A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
2020-08-22 03:32:07 +00:00
error[E0107]: wrong number of type arguments: expected 0, found 1
--> $DIR/invalid-enum.rs:21:12
|
LL | test_1::<CompileFlag::A>();
| ^^^^^^^^^^^^^^ unexpected type argument
|
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
LL | test_1::<{ CompileFlag::A }>();
| ^ ^
error[E0107]: wrong number of const arguments: expected 1, found 0
--> $DIR/invalid-enum.rs:26:3
|
LL | test_2::<_, CompileFlag::A>(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
error[E0107]: wrong number of type arguments: expected 1, found 2
--> $DIR/invalid-enum.rs:26:15
2020-08-22 03:32:07 +00:00
|
LL | test_2::<_, CompileFlag::A>(0);
| ^^^^^^^^^^^^^^ unexpected type argument
2020-08-22 03:32:07 +00:00
|
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
LL | test_2::<_, { CompileFlag::A }>(0);
| ^ ^
2020-08-22 03:32:07 +00:00
error: aborting due to 11 previous errors
2020-08-22 03:32:07 +00:00
Some errors have detailed explanations: E0107, E0573.
For more information about an error, try `rustc --explain E0107`.