Upgrading darling 0.14 to 0.20
Breaking0.14.4 → 0.20.11Breaking5Platform1Deprecated1New15Changed4Fixed9
BreakingUpgrade verdict
5 breaking changes and a platform requirement change.
In plain terms
- 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.
Must act 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).
What you must change
Breaking5
In GenericParamExt, as_lifetime_def is renamed to as_lifetime_param.
GenericParamExtas_lifetime_defas_lifetime_paramFlag and SpannedValue no longer implement syn::spanned::Spanned.
FlagSpannedValuesyn::spanned::SpannedReplaces all occurrences of syn::NestedMeta with darling::ast::NestedMeta.
syn::NestedMetadarling::ast::NestedMetaProvides a replacement for the deprecated AttributeArgs using NestedMeta::parse_meta_list.
AttributeArgsNestedMeta::parse_meta_listError::fromwrite_errorsIn GenericParamExt, LifetimeDef is now LifetimeParam.
GenericParamExtLifetimeDefLifetimeParamPlatform1
The MSRV (minimum supported Rust version) is now 1.56, because of syn.
Deprecations to plan for
Deprecated1
Warns that fields expecting syn::Expr cannot accept a string literal due to preserved quoting behavior.
syn::Expr