PackageTrack
Sign in Get early access

darling

A proc-macro library for reading attributes into structs when implementing custom derives.

0.24.1 666M downloads/mo #137 most downloaded on crates.io TedDriggs/darling

What this package is like to depend on

Last release 3 days ago

20 Aug 2026

Release timing varies

gaps range from 8 days to 9 months

Most releases are documented

notes for 57 of 65 stable releases

3 versions withdrawn

withdrawn after publishing

9 years old

69 releases · first in 2017

4 releases in the last 12 months

see the full history below

Release timeline

69 releases · May 2017 to Aug 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 69
  1. 0.24.1 20 Aug 2026
    Release notes
    • Don't assume fields using with impl FromMeta #433
    • #[allow(unused_qualifications)] in generated code #435
    • Do not include skipped variants in did-you-mean suggestions #427
    Open source →
    Release notes
    • Don't assume fields using with impl FromMeta #433
    • #[allow(unused_qualifications)] in generated code #435
    • Do not include skipped variants in did-you-mean suggestions #427
    Open source →
  2. 0.24.0 30 Jul 2026
    Release notes
    • Update syn to v3 #431
    • Add impl ToTokens for SpannedValue #423
    • Allow data magic field for FromDeriveInput to be any type that implements TryFrom<&syn::Data, Error = darling::Error> without needing to use #[darling(with = ...)] syntax #391
    Open source →
    Release notes
    • Update syn to v3 #431
    • Add impl ToTokens for SpannedValue #423
    • Allow data magic field for FromDeriveInput to be any type that implements TryFrom<&syn::Data, Error = darling::Error> without needing to use #[darling(with = ...)] syntax #391
    Open source →
  3. 0.23.0 03 Dec 2025
    Release notes
    • 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
    • Revert dependency version pins which caused problems #385
    Open source →
    Release notes
    • 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
    Open source →
  4. 0.22.0 02 Dec 2025 withdrawn
    Release notes

    YANKED Pinned dependencies made this version cause conflicts with other crates.

    • BREAKING: Remove 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
    • Add #[darling(default = || expr(val))] support, allowing a closure where a path was previously required #380
    • Preserve span information for paths given to darling::util::Callable as literal strings
    • Fix some documentation typos
    Open source →
    Release notes
    • BREAKING: Remove 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
    • Add #[darling(default = || expr(val))] support, allowing a closure where a path was previously required #380
    • Preserve span information for paths given to darling::util::Callable as literal strings
    • Fix some documentation typos
    Open source →
  5. 0.21.3 22 Aug 2025
    Release notes
    • Fix: Forward Override::<T>::from_expr to T::from_expr #371
    Open source →
    Release notes
    • Fix: Forward Override::<T>::from_expr to T::from_expr #371
    Open source →
  6. 0.21.2 14 Aug 2025
    Release notes
    • Add #[darling(from_expr = ...)] when deriving FromMeta to support overriding the key-value form #369
    • Keep parsing the body and type params even if there are errors from parsing attributes. #7
    • Support #[darling(with = ...)] on the generics field when deriving FromDeriveInput.
    • Return an error, rather than panicking, when doing shape validation on a union. #365
    Open source →
    Release notes
    • Add #[darling(from_expr = ...)] when deriving FromMeta to support overriding the key-value form #369
    • Keep parsing the body and type params even if there are errors from parsing attributes. #7
    • Support #[darling(with = ...)] on the generics field when deriving FromDeriveInput.
    • Return an error, rather than panicking, when doing shape validation on a union. #365
    Open source →
  7. 0.21.1 04 Aug 2025
    Release notes
    • Track all alternate field names, and show them in error message if there aren't too many. #325
    • Track all alternate values for enum variants, and show them in error messages if there aren't too many. #362
    Open source →
    Release notes
    • Track all alternate field names, and show them in error message if there aren't too many. #325
    • Track all alternate values for enum variants, and show them in error messages if there aren't too many. #362
    Open source →
  8. 0.21.0 10 Jul 2025
    Release notes
    • Potentially breaking: Emit error when an attribute path is present in both attributes and forward_attrs. #336
    • Support parsing attributes which contain keywords #238
    • Add SpannedValue::into_inner #342
    • Add #[darling(derive_syn_parse)] to also impl syn::parse::Parse when deriving FromMeta #285
    • Make impl FromMeta for syn::TypePath support both quote-wrapped and bare values #351
    • Add util::PreservedStrExpr #346
    • Impl UsesTypeParams and UsesLifetimes for WithOriginal #215
    • Update error message emitted by <() as FromMeta>::from_list to allow use of () as a #[darling(flatten)] target #353
    Open source →
    Release notes
    • Potentially breaking: Emit error when an attribute path is present in both attributes and forward_attrs. #336
    • Support parsing attributes which contain keywords #238
    • Add SpannedValue::into_inner #342
    • Add #[darling(derive_syn_parse)] to also impl syn::parse::Parse when deriving FromMeta #285
    • Make impl FromMeta for syn::TypePath support both quote-wrapped and bare values #351
    • Add util::PreservedStrExpr #346
    • Impl UsesTypeParams and UsesLifetimes for WithOriginal #215
    • Update error message emitted by <() as FromMeta>::from_list to allow use of () as a #[darling(flatten)] target #353
    Open source →
  9. 0.20.11 28 Mar 2025
    Release notes
    • Support #[darling(with = ...)] on the data field when deriving FromDeriveInput. This allows the use of simpler receiver types, such as a Vec of enum variants.
    • Bump version of proc-macro2 to 1.0.86.
    • Accept closures for #[darling(with = ...)] on fields in FromDeriveInput, FromMeta, FromField, etc. #309
    • Add darling::util::Callable to accept a path or closure as a meta-item expression
    • Add #[darling(from_word = ...)] and #[darling(from_none = ...)] to control shorthand and fallback behaviors for structs and enums deriving FromMeta #320
    • Add FromMeta impl for syn::ExprRange #329
    Open source →
    Release notes
    • Support #[darling(with = ...)] on the data field when deriving FromDeriveInput. This allows the use of simpler receiver types, such as a Vec of enum variants.
    • Bump version of proc-macro2 to 1.0.86.
    • Accept closures for #[darling(with = ...)] on fields in FromDeriveInput, FromMeta, FromField, etc. #309
    • Add darling::util::Callable to accept a path or closure as a meta-item expression
    • Add #[darling(from_word = ...)] and #[darling(from_none = ...)] to control shorthand and fallback behaviors for structs and enums deriving FromMeta #320
    • Add FromMeta impl for syn::ExprRange #329
    Open source →
  10. 0.20.10 09 Jul 2024
    Release notes
    • Add #[allow(clippy::manual_unwrap_or_default)] to all generated impls to avoid causing clippy fails in crates using darling #296
    • Properly initialize attrs magic field in derived FromAttributes impls #297
    Open source →
    Release notes
    • Add #[allow(clippy::manual_unwrap_or_default)] to all generated impls to avoid causing clippy fails in crates using darling #296
    • Properly initialize attrs magic field in derived FromAttributes impls #297
    Open source →
  11. 0.20.9 15 May 2024
    Release notes
    • Allow word-form for newtype enum variants whose only field produces a value when from_none is called on their type #249
    • Add FromMeta impls for the std::num::NonZero* types #288
    • Fix panic in number FromMeta impls when the parsed value is too large for the receiver type #289
    Open source →
  12. 0.20.8 23 Feb 2024
    Release notes
    • Add #[darling(with = ...)] support to attrs magic field to allow using custom receiver types for attrs #273
    Open source →
  13. 0.20.7 22 Feb 2024
    Release notes
    • Add #[darling(flatten)] to allow forwarding unknown fields to another struct #146
    • Don't suggest names of skipped fields in derived impls #268
    Open source →
  14. 0.20.6 14 Feb 2024
    Release notes
    • Fix some missing syn invisible group handling in FromMeta impls #263
    • Fix misleading error message on Error::unexpected_type so it no longer implies the type was a literal #264
    • Impl FromMeta Vec of literals, e.g. LitStr #265
    Open source →
  15. 0.20.5 31 Jan 2024
    Release notes
    • Add Flag::span inherent method, as Flag can no longer impl syn::spanned::Spanned #242
    Open source →
  16. 0.20.4 29 Jan 2024
    Release notes
    • Accept bare paths in #[darling(default = ...)] #258
    • Add FromMeta impl for PathBuf #259
    • Improve FromMeta implementation for enums #260
      • Properly implement unit arms in FromMeta::from_list to provide a consistent API for heterogeneous enums that include a mix of unit, newtype and struct variants
      • Add #[darling(word)] attribute for unit enum variants (See #63 for details)
    Open source →
  17. 0.20.3 12 Jul 2023
    Release notes
    • Add FromMeta impl for u128 and i128 #243
    Open source →
  18. 0.20.1 02 May 2023
    Release notes
    • Add Clone impl for NestedMeta #230
    Open source →
  19. 0.20.0 27 Apr 2023
    Release notes
    • Bump syn to version 2, courtesy of @jonasbb #227

    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, LifetimeDef is now LifetimeParam.
    • In GenericParamExt, as_lifetime_def is renamed to as_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.

    Open source →
  20. 0.14.4 09 Mar 2023
    Release notes
    • Add support for child diagnostics when diagnostics feature enabled #224
    Open source →
  21. 0.14.3 06 Feb 2023
    Release notes
    • Re-export syn from darling to avoid requiring that consuming crates have a syn dependency.
    • Change <SpannedValue<T> as FromMeta> impl to more precisely capture the value span, as opposed to the span of the entire item.
    • Add darling::util::{AsShape, Shape, ShapeSet} to improve "shape" validation for structs and variants. #222
    Open source →
  22. 0.14.2 26 Oct 2022
    Release notes
    • Derived impls of FromMeta will now error on literals, rather than silently ignoring them. #193
    • Don't include property paths in compile errors when spans are available. #203
    Open source →
  23. 0.14.1 28 Apr 2022
    Release notes
    • Fix a bug where using a trait that accepts #[darling(attributes(...))] without specifying any attributes would emit code that did not compile. #183
    • Impl Clone for darling::Error #184
    • Impl From<darling::Error> for syn::Error #184
    • Add Error::span and Error::explicit_span methods #184
    Open source →
  24. 0.14.0 13 Apr 2022
    Release notes
    • 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. 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
    • Remove need for #[darling(default)] on Option<T> and Flag fields #161
    • Improve validation of enum shapes #178
    • Bump proc-macro2 dependency to 1.0.37 #180
    • Bump quote dependency to 1.0.18 #180
    • Bump syn dependency to 1.0.91 #180
    Open source →
  25. 0.13.4 06 Apr 2022
    Release notes
    • Impl FromMeta for syn::Visibility #173
    Open source →
  26. 0.13.3 05 Apr 2022
    Release notes
    • Add error::Accumulator for dealing with multiple errors #164
    • Impl FromMeta for syn::Type and its variants #172
    Open source →
  27. 0.13.2 01 Apr 2022
    Release notes
    • Impl FromMeta for syn::ExprPath #169
    Open source →
  28. 0.13.1 07 Dec 2021
    Release notes
    • Add FromAttributes trait and macro #151
    Open source →
  29. 0.13.0 20 May 2021
    Release notes
    • Update darling to 2018 edition #129
    • Error on duplicate fields in #[darling(...)] attributes #130
    • Impl Copy for SpannedValue<T: Copy>
    • Add SpannedValue::map_ref
    Open source →
  30. 0.13.0-beta 21 Apr 2021 pre-release
    Release notes
    • Update darling to 2018 edition #129
    • Error on duplicate fields in #[darling(...)] attributes #130
    Open source →
  31. 0.12.4 20 Apr 2021
    Release notes
    • Add and_then to derive macros for darling
    Open source →
  32. 0.12.3 08 Apr 2021
    Release notes
    • Fix FromMeta impl for char not to panic #126
    Open source →
  33. 0.12.2 23 Feb 2021
    Release notes
    • Impl FromMeta for HashMap<Ident, V> and HashMap<Path, V>
    Open source →
  34. 0.12.1 22 Feb 2021
    Release notes
    • Impl FromMeta for syn::ExprArray #122
    • Remove use of unreachable from darling::ast::Data #123
    • Add darling::ast::Data::try_empty_from to avoid panics when trying to read a union body #123
    Open source →
  35. 0.12.0 05 Jan 2021
    Release notes
    • POSSIBLY BREAKING: Derived impls of 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. #113
    • Impl syn::spanned::Spanned for darling::util::SpannedValue #113
    • Add darling::util::parse_attribute_to_meta_list to provide useful errors during attribute parsing #113
    • Add impl From<syn::Error> for Error to losslessly propagate syn errors #116
    Open source →
  36. 0.11.0 14 Dec 2020
    Release notes
    • Bump minor version due to unexpected breaking change #107
    Open source →
  37. 0.10.3 10 Dec 2020 withdrawn
    Release notes
    • Add discriminant magic field when deriving FromVariant #105
    Open source →
  38. 0.10.2 30 Oct 2019
    Release notes
    • Bump syn dependency to 1.0.1 #83
    Open source →
  39. 0.10.1 25 Sep 2019
    Release notes
    • Fix test compilation errors #81
    Open source →
  40. 0.10.0 15 Aug 2019
    Release notes
    • Bump syn and quote to 1.0 #79
    • Increase rust version to 1.31
    Open source →
  41. 0.9.0 20 Mar 2019
    Release notes
    • Enable "did you mean" suggestions by default
    • Make darling_core::{codegen, options} private #58
    • Fix Override::as_mut: #66
    Open source →
  42. 0.8.6 18 Mar 2019
    Release notes
    • Added "did you mean" suggestions for unknown fields behind the suggestions flag #60
    • Added Error::unknown_field_with_alts to support the suggestion use-case.
    • Added ast::Fields::len and ast::Fields::is_empty methods.
    Open source →
  43. 0.8.5 04 Feb 2019
    Release notes
    • Accept unquoted positive numeric literals #52
    • Add FromMeta to the syn::Lit enum and its variants
    • Improve error message for unexpected literal formats to not say "other"
    Open source →
  44. 0.8.4 04 Feb 2019
    Release notes
    • Use syn::Error to provide precise errors before proc_macro::Diagnostic is available
    • Add diagnostics feature flag to toggle between stable and unstable error backends
    • Attach error information in more contexts
    • Add allow_unknown_fields to support parsing the same attribute multiple times for different macros #51
    • Proc-macro authors will now see better errors in darling attributes
    Open source →
  45. 0.8.3 21 Jan 2019
    Release notes
    • Attach spans to errors in generated trait impls #37
    • Attach spans to errors for types with provided bespoke implementations
    • Deprecate set_span from 0.8.2, as spans should never be broadened after being initially set
    Open source →
  46. 0.8.2 18 Jan 2019
    Release notes
    • Add spans to errors to make quality warnings and errors easy in darling. This is blocked on diagnostics stabilizing.
    • Add darling::util::SpannedValue so proc-macro authors can remember position information alongside parsed values.
    Open source →
  47. 0.8.1 12 Dec 2018

    Nothing published for this version

  48. 0.8.0 02 Oct 2018
    Release notes
    • Update dependency on syn to 0.15 #44. Thanks to @hcpl
    Open source →
  49. 0.7.0 24 Jul 2018
    Release notes
    • Update dependencies on syn and proc-macro2
    • Add util::IdentString, which acts as an Ident or its string equivalent
    Open source →
  50. 0.6.3 23 May 2018
    Release notes
    • Add support for Uses* traits in where predicates
    Open source →
  51. 0.6.2 22 May 2018
    Release notes
    • Add usage module for tracking type param and lifetime usage in generic declarations
      • Add UsesTypeParams and CollectsTypeParams traits #37
      • Add UsesLifetimes and CollectLifetimes traits #41
    • Don't add FromMeta bounds to type parameters only used by skipped fields #40
    Open source →
  52. 0.6.1 17 May 2018
    Release notes
    • Fix an issue where the syn update broke shape validation #36
    Open source →
  53. 0.6.0 16 May 2018
    Release notes

    Breaking Changes

    • Renamed FromMetaItem to FromMeta, and renamed from_meta_item method to from_meta
    • Added dedicated derive(FromMetaItem) which panics and redirects users to FromMeta
    Open source →
  54. 0.5.0 10 May 2018
    Release notes
    • Add ast::Generics and ast::GenericParam to work with generics in a manner similar to ast::Data
    • Add ast::GenericParamExt to support alternate representations of generic parameters
    • Add util::WithOriginal to get a parsed representation and syn's own struct for a syntax block
    • Add FromGenerics and FromGenericParam traits (without derive support)
    • Change generated code for generics magic field to invoke FromGenerics trait during parsing
    • Add FromTypeParam trait #30. Thanks to @upsuper
    Open source →
  55. 0.4.0 05 Apr 2018
    Release notes
    • Update dependencies on proc-macro, quote, and syn #26. Thanks to @hcpl
    Open source →
  56. 0.3.3 02 Apr 2018 withdrawn
    Release notes

    YANKED

    Open source →
  57. 0.3.2 13 Mar 2018
    Release notes
    • Derive Default on darling::Ignored (fixes #25).
    Open source →
  58. 0.3.1 07 Mar 2018
    Release notes
    • Support proc-macro2/nightly #24. Thanks to @kdy1
    Open source →
  59. 0.3.0 27 Jan 2018
    Release notes

    Breaking Changes

    • Update syn to 0.12 #20. Thanks to @Eijebong
    • Update quote to 0.4 #20. Thanks to @Eijebong
    • Rename magic field body in derived FromDeriveInput structs to data to stay in sync with syn
    • Rename magic field data in derived FromVariant structs to fields to stay in sync with syn
    Open source →
  60. 0.2.2 05 Dec 2017
    Release notes
    • Update lazy_static to 1.0 #15. Thanks to @Eijebong
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive