uses a proc-macro to automate command definitions
This commit is contained in:
10
api-proc-macro/tests/into_command_definition/enum_fails.rs
Normal file
10
api-proc-macro/tests/into_command_definition/enum_fails.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use api_proc_macro::IntoCommandDefinition;
|
||||
|
||||
#[derive(IntoCommandDefinition)]
|
||||
enum TestEnum {
|
||||
Variant
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: IntoCommandDefinition not supported for enum
|
||||
--> tests/into_command_definition/enum_fails.rs:4:1
|
||||
|
|
||||
4 | enum TestEnum {
|
||||
| ^^^^
|
||||
12
api-proc-macro/tests/into_command_definition/union_fails.rs
Normal file
12
api-proc-macro/tests/into_command_definition/union_fails.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use api_proc_macro::IntoCommandDefinition;
|
||||
|
||||
#[derive(IntoCommandDefinition)]
|
||||
#[repr(C)]
|
||||
union TestUnion {
|
||||
f1: u32,
|
||||
f2: f32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: IntoCommandDefinition not supported for union
|
||||
--> tests/into_command_definition/union_fails.rs:5:1
|
||||
|
|
||||
5 | union TestUnion {
|
||||
| ^^^^^
|
||||
@@ -0,0 +1,8 @@
|
||||
use api_proc_macro::IntoCommandDefinition;
|
||||
|
||||
#[derive(IntoCommandDefinition)]
|
||||
struct TestUnnamedStruct(f32, f64, bool);
|
||||
|
||||
fn main() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: IntoCommandDefinition not supported for unnamed structs
|
||||
--> tests/into_command_definition/unnamed_struct_fails.rs:4:25
|
||||
|
|
||||
4 | struct TestUnnamedStruct(f32, f64, bool);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
Reference in New Issue
Block a user