mirror of
https://github.com/valmojr/armatak.git
synced 2026-08-19 08:22:56 +00:00
idk
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
enum DeriveTest {}
|
||||
|
||||
fn main() {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
error: enums aren't supported
|
||||
--> tests/derive/fail_enum.rs:3:10
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `FromArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: enums aren't supported
|
||||
--> tests/derive/fail_enum.rs:3:20
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `IntoArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
@@ -0,0 +1,65 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma]
|
||||
struct NoList {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma("literal")]
|
||||
struct Literal {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(unknown)]
|
||||
struct Unknown {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(unknown::path)]
|
||||
struct UnknownPath {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(default, default)]
|
||||
struct Duplicate {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(default)]
|
||||
#[arma(default)]
|
||||
struct StackedDuplicate {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct FieldUnknown {
|
||||
#[arma(unknown)]
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct FieldDuplicate {
|
||||
#[arma(default, default)]
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct FieldStackedDuplicate {
|
||||
#[arma(default)]
|
||||
#[arma(default)]
|
||||
test: u32,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(unknown, default, default)]
|
||||
struct MultipleErrors {
|
||||
test: u32,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,65 @@
|
||||
error: expected attribute arguments in parentheses: #[arma(...)]
|
||||
--> tests/derive/fail_struct_attributes.rs:4:3
|
||||
|
|
||||
4 | #[arma]
|
||||
| ^^^^
|
||||
|
||||
error: unexpected literal in nested attribute, expected ident
|
||||
--> tests/derive/fail_struct_attributes.rs:10:8
|
||||
|
|
||||
10 | #[arma("literal")]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: unknown arma container attribute `unknown`
|
||||
--> tests/derive/fail_struct_attributes.rs:16:8
|
||||
|
|
||||
16 | #[arma(unknown)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: unknown arma container attribute `unknown::path`
|
||||
--> tests/derive/fail_struct_attributes.rs:22:8
|
||||
|
|
||||
22 | #[arma(unknown::path)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate arma attribute `default`
|
||||
--> tests/derive/fail_struct_attributes.rs:28:17
|
||||
|
|
||||
28 | #[arma(default, default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: duplicate arma attribute `default`
|
||||
--> tests/derive/fail_struct_attributes.rs:35:8
|
||||
|
|
||||
35 | #[arma(default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: unknown arma field attribute `unknown`
|
||||
--> tests/derive/fail_struct_attributes.rs:42:12
|
||||
|
|
||||
42 | #[arma(unknown)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: duplicate arma attribute `default`
|
||||
--> tests/derive/fail_struct_attributes.rs:48:21
|
||||
|
|
||||
48 | #[arma(default, default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: duplicate arma attribute `default`
|
||||
--> tests/derive/fail_struct_attributes.rs:55:12
|
||||
|
|
||||
55 | #[arma(default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: unknown arma container attribute `unknown`
|
||||
--> tests/derive/fail_struct_attributes.rs:60:8
|
||||
|
|
||||
60 | #[arma(unknown, default, default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: duplicate arma attribute `default`
|
||||
--> tests/derive/fail_struct_attributes.rs:60:26
|
||||
|
|
||||
60 | #[arma(unknown, default, default)]
|
||||
| ^^^^^^^
|
||||
@@ -0,0 +1,16 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(transparent, default)]
|
||||
struct Container {
|
||||
first: String,
|
||||
}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(transparent)]
|
||||
struct Field {
|
||||
#[arma(default)]
|
||||
first: String,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: #[arma(default)] and #[arma(transparent)] cannot be used together
|
||||
--> tests/derive/fail_struct_map_transparent_default.rs:4:21
|
||||
|
|
||||
4 | #[arma(transparent, default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: #[arma(default)] and #[arma(transparent)] cannot be used together
|
||||
--> tests/derive/fail_struct_map_transparent_default.rs:12:12
|
||||
|
|
||||
12 | #[arma(default)]
|
||||
| ^^^^^^^
|
||||
@@ -0,0 +1,10 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(transparent)]
|
||||
struct TooManyFields {
|
||||
first: String,
|
||||
second: String,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: #[arma(transparent)] structs must have exactly one field
|
||||
--> tests/derive/fail_struct_map_transparent_multi.rs:4:8
|
||||
|
|
||||
4 | #[arma(transparent)]
|
||||
| ^^^^^^^^^^^
|
||||
@@ -0,0 +1,10 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(default)]
|
||||
struct Container(u32);
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct Field(#[arma(default)] u32);
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: #[arma(default)] cannot be used on new type structs
|
||||
--> tests/derive/fail_struct_newtype_default.rs:4:8
|
||||
|
|
||||
4 | #[arma(default)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: #[arma(default)] cannot be used on new type structs
|
||||
--> tests/derive/fail_struct_newtype_default.rs:8:21
|
||||
|
|
||||
8 | struct Field(#[arma(default)] u32);
|
||||
| ^^^^^^^
|
||||
@@ -0,0 +1,6 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct DeriveTest(#[arma(default)] String, u32, bool);
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: field must have #[arma(default)] because previous field 0 has #[arma(default)]
|
||||
--> tests/derive/fail_struct_tuple_default_field_first.rs:4:44
|
||||
|
|
||||
4 | struct DeriveTest(#[arma(default)] String, u32, bool);
|
||||
| ^^^
|
||||
|
||||
error: field must have #[arma(default)] because previous field 0 has #[arma(default)]
|
||||
--> tests/derive/fail_struct_tuple_default_field_first.rs:4:49
|
||||
|
|
||||
4 | struct DeriveTest(#[arma(default)] String, u32, bool);
|
||||
| ^^^^
|
||||
@@ -0,0 +1,7 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
#[arma(transparent)]
|
||||
struct DeriveTest(String, u32);
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: #[arma(transparent)] cannot be used on tuple like structs
|
||||
--> tests/derive/fail_struct_tuple_transparent.rs:4:8
|
||||
|
|
||||
4 | #[arma(transparent)]
|
||||
| ^^^^^^^^^^^
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct Unit;
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct EmptyMap {}
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct EmptyTuple();
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,47 @@
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:3:10
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `FromArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:3:20
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `IntoArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:6:10
|
||||
|
|
||||
6 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `FromArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:6:20
|
||||
|
|
||||
6 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `IntoArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:9:10
|
||||
|
|
||||
9 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `FromArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unit-like structs aren't supported
|
||||
--> tests/derive/fail_struct_unit.rs:9:20
|
||||
|
|
||||
9 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `IntoArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
union DeriveTest {
|
||||
first: u32,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
error: unions aren't supported
|
||||
--> tests/derive/fail_union.rs:3:10
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `FromArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unions aren't supported
|
||||
--> tests/derive/fail_union.rs:3:20
|
||||
|
|
||||
3 | #[derive(FromArma, IntoArma)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `IntoArma` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
@@ -0,0 +1,21 @@
|
||||
use arma_rs::{FromArma, FromArmaError, IntoArma, Value};
|
||||
|
||||
#[derive(IntoArma)]
|
||||
struct CustomFrom(u32);
|
||||
|
||||
impl FromArma for CustomFrom {
|
||||
fn from_arma(_: String) -> Result<Self, FromArmaError> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(FromArma)]
|
||||
struct CustomInto(u32);
|
||||
|
||||
impl IntoArma for CustomInto {
|
||||
fn to_arma(&self) -> Value {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,22 @@
|
||||
use arma_rs::{FromArma, IntoArma};
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct Newtype<T: IntoArma + FromArma>(T);
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct Tuple<A, B>(A, B)
|
||||
where
|
||||
A: IntoArma + FromArma,
|
||||
B: IntoArma + FromArma;
|
||||
|
||||
#[derive(FromArma, IntoArma)]
|
||||
struct Map<A, B>
|
||||
where
|
||||
A: IntoArma + FromArma,
|
||||
B: IntoArma + FromArma,
|
||||
{
|
||||
first: A,
|
||||
second: B,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user