NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #121 most downloaded on crates.io
A proc-macro library for reading attributes into structs when implementing custom derives.
Latest stable
0.24.1
Last release 3 months ago
20 Aug 2026
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
10 years old
69 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Don't assume fields using with impl FromMeta #433
Add impl ToTokens for SpannedValue #423
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Bump MSRV to 1.88.0; there have been no code changes that caused this, but due to dependency issues CI no longer works on 1.56.0 #357
YANKED Pinned dependencies made this version cause conflicts with other crates.
YANKED Pinned dependencies made this version cause conflicts with other crates.
fnv dependency, as runtime performance gain does not justify additional dependency. This was exposed to users of darling::usage, so it may be breaking for them #373#[darling(default = || expr(val))] support, allowing a closure where a path was previously required #380darling::util::Callable as literal stringsFix: Forward Override::<T>::from_expr to T::from_expr #371
Override::<T>::from_expr to T::from_expr #371Add #[darling(from_expr = ...)] when deriving FromMeta to support overriding the key-value form #369
#[darling(from_expr = ...)] when deriving FromMeta to support overriding the key-value form #369#[darling(with = ...)] on the generics field when deriving FromDeriveInput.union. #365Track all alternate field names, and show them in error message if there aren't too many. #325
Potentially breaking: Emit error when an attribute path is present in both attributes and forward_attrs . #336
attributes and forward_attrs. #336SpannedValue::into_inner #342#[darling(derive_syn_parse)] to also impl syn::parse::Parse when deriving FromMeta #285impl FromMeta for syn::TypePath support both quote-wrapped and bare values #351util::PreservedStrExpr #346UsesTypeParams and UsesLifetimes for WithOriginal #215<() as FromMeta>::from_list to allow use of () as a #[darling(flatten)] target #353Support #[darling(with = ...)] on the data field when deriving FromDeriveInput . This allows the use of simpler receiver types, such as a Vec of enum
#[darling(with = ...)] on the data field when deriving FromDeriveInput. This allows the use of simpler receiver types, such as a Vec of enum variants.proc-macro2 to 1.0.86.#[darling(with = ...)] on fields in FromDeriveInput, FromMeta, FromField, etc. #309darling::util::Callable to accept a path or closure as a meta-item expression#[darling(from_word = ...)] and #[darling(from_none = ...)] to control shorthand and fallback behaviors for structs and enums deriving FromMeta #320FromMeta impl for syn::ExprRange #329Add #[allow(clippy::manual_unwrap_or_default)] to all generated impls to avoid causing clippy fails in crates using darling #296
Allow word-form for newtype enum variants whose only field produces a value when from_none is called on their type #249
Add #[darling(with = ...)] support to attrs magic field to allow using custom receiver types for attrs #273
#[darling(with = ...)] support to attrs magic field to allow using custom receiver types for attrs #273Add #[darling(flatten)] to allow forwarding unknown fields to another struct #146
Fix some missing syn invisible group handling in FromMeta impls #263
Add Flag::span inherent method, as Flag can no longer impl syn::Spanned #242
Flag::span inherent method, as Flag can no longer impl syn::spanned::Spanned #242Accept bare paths in #[darling(default = ...)] #258
#[darling(default = ...)] #258FromMeta impl for PathBuf #259FromMeta implementation for enums #260
FromMeta::from_list to provide a consistent API for heterogeneous enums that include a mix of unit, newtype and struct variants#[darling(word)] attribute for unit enum variants (See #63 for details)Add FromMeta impl for u128 and i128 #243
FromMeta impl for u128 and i128 #243This release also includes features originally slated for 0.20.2, as that was never published.
Add Clone impl for NestedMeta #230
Clone impl for NestedMeta #230Replacement for the deprecated AttributeArgs:
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());
}
};
LifetimeDef is now LifetimeParam.as_lifetime_def is renamed to as_lifetime_param.syn::spanned::Spanned.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.
Add support for child diagnostics when diagnostics feature enabled #224
diagnostics feature enabled #224Re-export syn from darling to avoid requiring that consuming crates have a syn dependency.
syn from darling to avoid requiring that consuming crates have a syn dependency.<SpannedValue<T> as FromMeta> impl to more precisely capture the value span, as opposed to the span of the entire item.darling::util::{AsShape, Shape, ShapeSet} to improve "shape" validation for structs and variants. #222Derived impls of FromMeta will now error on literals, rather than silently ignoring them. #193
Fix a bug where using a trait that accepts #[darling(attributes(...))] without specifying any attributes would emit code that did not compile. #183
BREAKING CHANGE: Remove many trait impls from util::Flag. This type had a number of deref and operator impls that made it usable as sort-of-a-boolean.…
util::Flag.
This type had a number of deref and operator impls that made it usable as sort-of-a-boolean.
Real-world usage showed this type is more useful if it's able to carry a span for good errors,
and that most of those impls were unnecessary. #179#[darling(default)] on Option<T> and Flag fields #161proc-macro2 dependency to 1.0.37 #180quote dependency to 1.0.18 #180syn dependency to 1.0.91 #180Impl FromMeta for syn::Visibility #173
FromMeta for syn::Visibility #173Impl FromMeta for syn::Type and its newtype variants #172
Impl FromMeta for syn::ExprPath #170
FromMeta for syn::ExprPath #170Add FromAttributes trait and macro #151
Error on duplicate fields in #[darling(...)] attributes #130
Update darling to 2018 edition #129
Add #[darling(and_then = "...")] as an alternative to #[darling(map = "...")]
#[darling(and_then = "...")] as an alternative to #[darling(map = "...")]Fix FromMeta impl for char #126
FromMeta impl for char #126Impl FromMeta for HashMap with Path and Ident keys
FromMeta for HashMap with Path and Ident keysImpl FromMeta for ExprArray and various integer Vecs #122
FromMeta for ExprArray and various integer Vecs #122unreachable from darling::ast::Data #123darling::ast::Data::try_empty_from #123POSSIBLY BREAKING: Derived impls of FromDeriveInput, FromField, FromVariant, and FromTypeParam will now error when encountering an attribute darling h
FromDeriveInput, FromField, FromVariant, and FromTypeParam will now error when encountering an attribute darling has been asked to parse that isn't a supported shape. Any crates using darling that relied on those attributes being silently ignored could see new errors reported in their dependent crates. #113syn::spanned::Spanned for darling::util::SpannedValue #113darling::util::parse_attribute_to_meta_list to provide useful errors during attribute parsing #113impl From<syn::Error> for Error to losslessly propagate syn errors #116Fixes semver breakage from v0.10.3
For additional information, see CHANGELOG.md
Add discriminant magic field when deriving FromVariant #105
discriminant magic field when deriving FromVariant #105Bump syn dependency to 1.0.1 #83 - we were using a feature of syn that wasn't in 1.0.0, which could cause CI failures.
syn that wasn't in 1.0.0, which could cause CI failures.Fix test compilation failure #81
* Bump syn and quote to 1.0 * Bump rust min-version to 1.31
syn and quote to 1.0Enable "did you mean" suggestions by default
Added "did you mean" suggestions for unknown fields behind the suggestions flag #60
suggestions flag #60Error::unknown_field_with_alts to support the suggestion use-case.ast::Fields::len and ast::Fields::is_empty methods.LICENSE files to darling_core and darling_macroAccept unquoted positive numeric literals #52
FromMeta to the syn::Lit enum and its variantsSubstantially overhaul errors #39
syn::Error to provide precise errors before proc_macro::Diagnostic is availablediagnostics feature flag to toggle between stable and unstable error backendsallow_unknown_fields to support parsing the same attribute multiple times for different macros #51darling attributesAdd Span support to darling::Error in preparation for proc-macros being allowed to emit diagnostics. This change will cause errors encountered by darl
Add Span support to darling::Error in preparation for proc-macros being allowed to emit diagnostics. This change will cause errors encountered by darling to point to the right locations in user source code, which will make darling-backed crates much more ergonomic to use.
set_span from 0.8.2, as spans should never be broadened after being initially setAdd spans to errors to make quality warnings and errors easy in darling. This is blocked on diagnostics stabilizing.
darling::util::SpannedValue so proc-macro authors can remember position information alongside parsed values.Nothing published for this version
Update syn to 0.15 #44. Thanks to @hcpl
syn to 0.15 #44. Thanks to @hcplUpdate dependencies on serde and proc-macro2
serde and proc-macro2IdentString to handle cases where code needs to treat idents as stringssyn and proc-macro2util::IdentString, which acts as an Ident or its string equivalentExtend the coverage of UsesTypeParams and UsesLifetimes
Extend the coverage of UsesTypeParams and UsesLifetimes
Add the usage module, with UsesTypeParams and UsesLifetimes. These traits help track usage of generic parameters throughout a proc-macro input, simpli
Add the usage module, with UsesTypeParams and UsesLifetimes. These traits help track usage of generic parameters throughout a proc-macro input, simplifying bounding or generation of derivative structs. See #40 and #41
Fixed an issue with supports(struct_*) caused by the syn upgrade, and added tests to make sure it doesn't break again.
supports(struct_*) caused by the syn upgrade, and added tests to make sure it doesn't break again.Rename FromMetaItem to FromMeta
Rename FromMetaItem to FromMeta
FromMetaItem to FromMeta, and renamed from_meta_item method to from_metaderive(FromMetaItem) which panics and redirects users to FromMetaAdd ast::Generics and ast::GenericParam to work with generics in a manner similar to ast::Data
ast::Generics and ast::GenericParam to work with generics in a manner similar to ast::Dataast::GenericParamExt to support alternate representations of generic parametersutil::WithOriginal to get a parsed representation and syn's own struct for a syntax blockFromGenerics and FromGenericParam traits (without derive support)generics magic field to invoke FromGenerics trait during parsingFromTypeParam trait #30. Thanks to @upsuperUpdate dependencies on proc-macro, quote, and syn #26. Thanks to @hcpl
proc-macro, quote, and syn #26. Thanks to @hcplUpdate dependencies #26. Thanks to @hcpl
Derive Default on darling::Ignored (fixes #25).
Default on darling::Ignored (fixes #25).Add support for proc-macro-2
Add support for proc-macro-2 (#24)
Update syn to 0.12 #20. Thanks to @Eijebong
Update lazy_static to 1.0 #16 - thanks to @Eijebong
lazy_static to 1.0 #16 - thanks to @EijebongOne column per quarter.