diff --git a/Cargo.lock b/Cargo.lock index ff3b50e..caec350 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ dependencies = [ [[package]] name = "onlyargs_derive" -version = "0.1.3" +version = "0.1.4" dependencies = [ "myn", "onlyargs", diff --git a/onlyargs_derive/Cargo.toml b/onlyargs_derive/Cargo.toml index 7f24ad9..ee64bb8 100644 --- a/onlyargs_derive/Cargo.toml +++ b/onlyargs_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "onlyargs_derive" description = "Obsessively tiny argument parsing derive macro" -version = "0.1.3" +version = "0.1.4" authors = ["Jay Oster "] repository = "https://github.com/parasyte/onlyargs" edition = "2021" diff --git a/onlyargs_derive/compile_tests/compiler.rs b/onlyargs_derive/compile_tests/compiler.rs index e486e4d..740489c 100644 --- a/onlyargs_derive/compile_tests/compiler.rs +++ b/onlyargs_derive/compile_tests/compiler.rs @@ -28,7 +28,9 @@ fn compile_tests() { t.pass("compile_tests/positional_pathbuf.rs"); t.pass("compile_tests/positional_string.rs"); t.pass("compile_tests/positional_u8.rs"); + t.pass("compile_tests/positional_u128.rs"); t.pass("compile_tests/positional_usize.rs"); + t.compile_fail("compile_tests/conflicting_positional.rs"); t.pass("compile_tests/empty.rs"); t.pass("compile_tests/optional.rs"); diff --git a/onlyargs_derive/compile_tests/conflicting_positional.rs b/onlyargs_derive/compile_tests/conflicting_positional.rs new file mode 100644 index 0000000..3b9f2b2 --- /dev/null +++ b/onlyargs_derive/compile_tests/conflicting_positional.rs @@ -0,0 +1,7 @@ +#[derive(Debug, onlyargs_derive::OnlyArgs)] +struct Args { + rest: Vec, + more: Vec, +} + +fn main() {} diff --git a/onlyargs_derive/compile_tests/conflicting_positional.stderr b/onlyargs_derive/compile_tests/conflicting_positional.stderr new file mode 100644 index 0000000..f385a2c --- /dev/null +++ b/onlyargs_derive/compile_tests/conflicting_positional.stderr @@ -0,0 +1,5 @@ +error: Positional arguments can only be specified once. + --> compile_tests/conflicting_positional.rs:4:5 + | +4 | more: Vec, + | ^^^^