ZeroTierOne/zeroidc/vendor/darling/tests/generics.rs
Grant Limberg a59626c971
Bump zeroidc dependencies (#1847)
openidconnect -> 2.5
base64 -> 0.21
url -> 2.3
bytes -> 1.3
2023-01-12 13:24:58 -08:00

23 lines
427 B
Rust

#![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();
}