1
0
Fork 0
firefox/third_party/rust/darling/tests/generics.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02: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();
}