diff options
Diffstat (limited to 'vendor/darling/tests/generics.rs')
-rw-r--r-- | vendor/darling/tests/generics.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/darling/tests/generics.rs b/vendor/darling/tests/generics.rs new file mode 100644 index 000000000..ba65781fe --- /dev/null +++ b/vendor/darling/tests/generics.rs @@ -0,0 +1,23 @@ +#![allow(dead_code)] + +use darling::{FromDeriveInput, FromMeta}; +use syn::parse_quote; + +#[derive(Debug, Clone, FromMeta)] +struct Wrapper<T>(pub T); + +#[derive(Debug, FromDeriveInput)] +#[darling(attributes(hello))] +struct Foo<T> { + lorem: Wrapper<T>, +} + +#[test] +fn expansion() { + let di = parse_quote! { + #[hello(lorem = "Hello")] + pub struct Foo; + }; + + Foo::<String>::from_derive_input(&di).unwrap(); +} |