Skip to content

Fix span of missing argument errors in nested structs.

Choose a tag to compare

@Techcable Techcable released this 04 Oct 06:20
07c1ebf

With the assistance of Claude Code, this release includes many other fixes and cleanups.

Added

  • Implement Debug for NestedDict (kwsztwtm)
  • Implement Default for NestedDict, allowing use with #[kwarg(optional)] (xlmlvnwn)

Changed

  • Declare minimum supported rust version of 1.71 (mrvqwsux)
    • This is the oldest version that syn v3 supports.
  • Relicense from MIT to MIT OR Apache-2.0 (kxrrqpts)
    • Since the MIT license is still an option, this change actually makes licensing more permissive.
  • Require the exact matching version of macro-kwargs-derive (ultltztn)
    • Generated code relies on internal APIs, so mismatched versions could fail to compile.
  • Reject integer and float literals whose suffix doesn't match the target type (sovtoywz)
    • For example, 5i64 can no longer be parsed as a u8. Unsuffixed literals are unaffected.
    • This is technically a breaking change, but any code that relied on the prior behavior was buggy.

Fixed

  • Fix span of missing argument errors in nested structs (pnrqmzup)
  • Avoid redundant_field_names lint in generated code (nvqqkunl)
  • Fix #[kwarg(with_func = "...")], which previously failed to compile as the function wasn't properly called (movmzuok)
  • Generated code no longer requires a direct dependency on syn or proc-macro2 (vlkusror)
  • Fix parse_macro_arg_via_syn! when invoked by path or without syn in scope (ossnuvpr)
  • Point ExplicitOption parse errors at the unexpected identifier instead of the token after it (sxzzzyzv)
  • Allow fields named argument_list or missing_argument_errors, which clashed with locals in generated code (vrtqvqnq)
  • Reject fields with duplicate argument names (via rename), which previously made one of them impossible to set (owonzqoy)
  • Fields with raw names like r#type now take the argument type instead of r#type; both spellings are accepted (zunuotso)
  • NestedDict reports every duplicate key, instead of stopping at the first one (xuuxssvv)
  • Correct the docs for ParsedKeywordArguments ordering: arguments are in the order the user wrote them, not the order the fields are declared in (rwmympok)
    • This was already the actual behavior; only the documentation was wrong.
  • Allow a trailing comma in #[kwarg(...)], like #[kwarg(optional,)] (xwwsquxv)
  • Fix derive failing on fields whose names differ only in case or underscores, like foo_bar and foo__bar (loplrtmk)
    • Avoid non_snake_case warnings in generated code for fields that aren't snake case.
  • Reject generic structs in the derive with a clear error, instead of failing with confusing errors in generated code (klptmunk)