summaryrefslogtreecommitdiffstats
path: root/vendor/darling-0.14.4/tests/generics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/darling-0.14.4/tests/generics.rs')
-rw-r--r--vendor/darling-0.14.4/tests/generics.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/darling-0.14.4/tests/generics.rs b/vendor/darling-0.14.4/tests/generics.rs
new file mode 100644
index 000000000..ba65781fe
--- /dev/null
+++ b/vendor/darling-0.14.4/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();
+}