Skip to content

Upgrading darling 0.14 to 0.20

Breaking0.14.4 → 0.20.11Breaking5Platform1Deprecated1New15Changed4Fixed9

BreakingUpgrade verdict

5 breaking changes and a platform requirement change.

  • A method in the generic parameter helper was renamed.
  • Two types lost a trait implementation, so code relying on it must change.
  • Code that used the old nested attribute type must switch to darling's own type.
  • The old way of parsing macro arguments is replaced by a new parsing call.
Top 5 of 7 that need code or config changes

Requires Rust 1.56 from 0.20.9 (none stated before).

Installs 25 packages in all (was 26).

Breaking5
In GenericParamExt, as_lifetime_def is renamed to as_lifetime_param.
GenericParamExtas_lifetime_defas_lifetime_param
Flag and SpannedValue no longer implement syn::spanned::Spanned.
FlagSpannedValuesyn::spanned::Spanned
Replaces all occurrences of syn::NestedMeta with darling::ast::NestedMeta.
syn::NestedMetadarling::ast::NestedMeta
Provides a replacement for the deprecated AttributeArgs using NestedMeta::parse_meta_list.
AttributeArgsNestedMeta::parse_meta_listError::fromwrite_errors
In GenericParamExt, LifetimeDef is now LifetimeParam.
GenericParamExtLifetimeDefLifetimeParam
Platform1
The MSRV (minimum supported Rust version) is now 1.56, because of syn.
Deprecated1
Warns that fields expecting syn::Expr cannot accept a string literal due to preserved quoting behavior.
syn::Expr