Repository navigation
v0.20.0
v0.20.0 (April 27, 2023)
Breaking Changes
-
Replace all occurrences of syn::NestedMeta with darling::ast::NestedMeta.
-
Replacement for the deprecated AttributeArgs:
// Before
parse_macro_input!(args as AttributeArgs);
// After
match NestedMeta::parse_meta_list(args) {
Ok(v) => v,
Err(e) => {
return TokenStream::from(Error::from(e).write_errors());
}
};- In GenericParamExt,
LifetimeDefis nowLifetimeParam. - In GenericParamExt,
as_lifetime_defis renamed toas_lifetime_param. - Flag and SpannedValue no longer implement
syn::spanned::Spanned. - The MSRV (minimum supported Rust version) is now 1.56, because of syn.
Deprecation Warnings
In previous versions of darling, arbitrary expressions were passed in attributes by wrapping them in quotation marks.
v0.20.0 preserves this behavior for syn::Expr, but as a result a field expecting a syn::Expr cannot accept a string literal - it will incorrectly attempt to parse the contents. If this is an issue for you, please add a comment to #229.