fix(deps): update rust crate bon to v3 #51

Open
renovate wants to merge 1 commit from renovate/bon-3.x into main
Collaborator

This PR contains the following updates:

Package Type Update Change
bon (source) dependencies major 2.3.0 -> 3.0.0

⚠️ Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

elastio/bon (bon)

v3.7.1

Compare Source

This is a small patch release to make bon easier to package for Debian.

Other
  • Add Copyright header to the MIT License (#​331)
Internal
  • Fix MSRV tests and lints from nightly 13-08-2025 (#​329)
  • Revert refactoring PR 320 to make code compatible with darling 0.20 (#​332)

v3.7.0

Compare Source

Added
Fixed
  • Add missing where clause forwarding to #[builder(derive(Into))] (#​325)
Internal
  • Make tests pass without the experimental-overwritable feature (#​326)
  • Sunset financial support by Kindness (#​324)
  • Fix clippy lints from nightly (2025-08-09) (#​323)

v3.6.5

Compare Source

This is a regular maintenance release with no essential API/behavior changes. Enjoy the stability 😄.

Docs
  • Add all 3 variations of builder syntax to the Basics guide pages (#​315)
Internal
  • Update the dependency darling (crate for parsing the attributes) from 0.20 to 0.21 and other internal dependencies (#​317, #​320, #​304)
  • Switch from iai to iai-callgrind for high-precision benchmarking of bon (#​311). iai-callgrind is a better maintained alternative to iai, but in any case, both deserve a huge thanks for providing the benchmarking capabilities for bon!
  • Migrate to OIDC for trusted publishing. Huge thanks for this new crates.io feature to everyone who made it happen! (#​318)
  • Fix clippy::or_fun_call lint from the nightly toolchain (#​316)

v3.6.4

Compare Source

Added
  • Improve error reporting when using the #[bon::builder] fully qualified attribute inside of impl blocks (#​297)

v3.6.3

Compare Source

Fixed
  • Fix missing support for #[builder(field)] with #[builder(const)] (#​291)

v3.6.2

Compare Source

Added
  • Propagate #[target_feature] attributes on #[builder]-generated finishing functions (#​284). Thanks @​Lilyyy411 for the contribution!
Fixed
  • Fix visibility and const token order in code generated by #[builder(const)] (#​288)

v3.6.1

Compare Source

Fixed
  • Propagate #[track_caller] to the generated finishing function from the underlying function/method (#​282). Thanks @​Lilyyy411 for the contribution!

v3.6.0

Compare Source

Added
  • Add very limited support for #[builder(const)] (#​279).
    See the updated docs here

v3.5.2

Compare Source

Fixed
  • Small fix for rust-analyzer syntax highlighting of parameters for functions annotated with #[builder] (#​275).
    This doesn't fix the problem fully since function parameters are now assigned "variable" semantic token type instead of "parameter". However, it's already better than "struct" that they were assigned before this fix. Created an issue in rust-analyzer with more details and to get the full fix of this problem: rust-lang/rust-analyzer#19556.
  • Fix lints on nightly 2025-03-20 (#​272)

v3.5.1

Compare Source

Fixed
  • Delay the privatizing (i.e. renaming of the original function to __orig_{fn_name}) until after all other macros are expanded (#​269). Also removed the warnings for #[tracing::instrument] users introduced in #​264. This is because with this patch there will be no difference whether you place #[tracing::instrument] after or before the #[builder] attribute - all other proc macros on the function will see the original function name.

v3.5.0

Compare Source

Added
  • Introduce setters(doc(default(skip))) attribute to skip the inclusion of the default value in the generated docs for setters (#​265). See the updated docs here.
Fixed
  • Trigger a compiler warning if #[tracing::instrument] is placed after the #[builder] instead of before (#​264). This should prevent the papercut where tracing::instrument assigns the span name with the ugly __orig_ prefix in the name.
  • Fix repeated #[builder] attributes getting ignored on free functions (#​263)

v3.4.0

Compare Source

Added
  • Stabilize the current #[builder(getter)] attribute MVP (#​251).
    The cargo feature experimental-getters is no longer needed and is now no-op.
  • Make self receiver and start_fn members available as official fields on the builder (#​250).
    Check the new documentation page about native fields.
  • Introduce #[builder(derive(Into))] attribute to generate an impl From<Builder> for T (#​248).
    See the updated "Inspecting" guide page now known as Derives for Builders and the updated #[builder(derive)] reference.
Other
Acknowledgements
  • Gratitude to the Kindness.ai team who started supporting on OpenCollective at 100$ a month!
  • Gratitude to Ethan Skowronski who started supporting on Patreon at 1$ a month!

v3.3.2

Compare Source

Fixed
  • Fix syntax errors caused by PascalCasification when generating code for members named self_ (#​238)

v3.3.1

Compare Source

Fixed
  • Fix clippy::empty_enum triggering on nightly with feature(never_type) enabled (#​234)

v3.3.0

Compare Source

Added

v3.2.0

Compare Source

Added

v3.1.1

Compare Source

Fixed
  • Make generated identifiers of private fields deterministic. This is important for the Buck build system and probably for Bazel as well (#​219)

v3.1.0

Compare Source

Added
Other
  • Internal refactoring of naming in bons test suite (#​215)

v3.0.2

Compare Source

Fixed
  • Fix unexpected_cfgs lint coming from #[cfg(rust_analyzer)] on the latest nightly (#​212)

v3.0.1

Compare Source

Fixed
  • Fix handling of lifetimes not used in fn param types (#​208)

v3.0.0

Compare Source

See the most interesting changes described in Bon 3.0 Release blog post.

All the breaking changes are very unlikely to actually break your code that was written against the v2 version of bon. 99% of users should be able to update without any migration.

Changed
  • 🎉🎉 Stabilize the builder's typestate API allowing for custom builder extensions. This is the main theme of this release. This new API brings the flexibility to a whole new level 🚀 🚀 (#​145)

  • Improve rustdoc output. See the rustoc examples and comparison in the Alternatives section (#​145)

    • Add info that the member is required or optional.

    • For members with default values show the default value in the docs.

    • For optional members provide links to {member}(T) and maybe_{member}(Option<T>) setters.

    • Remove __ prefixes for generic types and lifetimes from internal symbols. Instead, the prefixes added only if the macro detects a name collision.

  • ⚠️ Breaking. Reject unnecessary empty attributes e.g. #[builder()] or #[builder] with no parameters on a member (#​145)

  • ⚠️ Breaking. Reject square brackets and curly braces delimiters for builder_type, finish_fn, start_fn and on attributes syntax. Only parentheses are accepted e.g. #[builder(finish_fn(...))] or #[builder(on(...))]. This no longer works: #[builder(finish_fn[...])] or #[builder(on{...})] (#​145)

  • ⚠️ Breaking. Reject non-consecutive on(...) clauses. For example, the following now generates a compile error: #[builder(on(String, into), finish_fn = build, on(Vec<_>, into))], because there is a finish_fn = ... between on(...) clauses. (#​155)

  • ⚠️ Breaking. #[builder(derive(Clone, Debug))] now generates impl blocks that follow the behaviour of standard Clone and Debug derives in that it conservatively adds Clone/Debug trait bounds for all the generic types declared on the original item (struct or function). Previously no additional bounds were required on Clone and Debug impls. See the Added section for details on the way to override these bounds with #[builder(derive(Clone/Debug(bounds(...))))] (#​145)

  • ⚠️ Breaking. The name of the builder struct generated for methods named builder changed from TBuilderBuilder to just TBuilder making methods named builder work the same as methods named new. (#​145)

  • ⚠️ Breaking. The type of the builder is now dependent on the order of the setters' invocation. This may only break code like the following:

    let builder = if condition {
        Foo::builder().a(1).b(2)
    } else {
        Foo::builder().b(1).a(2)
    };
    
    builder.build();
    

    This is because the types of the builders returned from the branches are the following:

    • FooBuilder<SetB<SetA>> (if branch)
    • FooBuilder<SetA<SetB>> (else branch)

    We believe such code should generally be very rare and even if it breaks, it's easy to fix it by reordering the setter method calls. This compromise was accepted as a design tradeoff such that the builder's type signature becomes simpler, the generated documentation becomes much less noisy, it removes an annoying special case for the builder of just one member, and it improves the type-checking performance considerably compared to the previous approach that used tuples to represent the type state. (#​145)

Removed
  • ⚠️ Breaking. Remove support for #[bon::builder] proc-macro attribute on top of a struct. Use #[derive(bon::Builder)] for that instead. This syntax has been deprecated since 2.1 and it is now removed as part of a major version cleanup (#​145)

  • ⚠️ Breaking. Remove #[builder(expose_positional_fn = positional_fn_name)] attribute. Use #[builder(start_fn = builder_fn_name)] instead, since this attribute works additively keeping the function with positional arguments under the attribute unchanged. (#​153)

Added
  • ⚠️ Breaking. Builder macros now generate additional mod builder_name {} where builder_name is the snake_case version of the name of the builder struct. This new module contains the type state API of the builder. There is a low probability that this new module name may conflict with existing symbols in your scope, so this change is marked as breaking (#​145)

  • Add #[builder(builder_type(vis = "...", doc { ... }))] that allows overriding the visibility and docs of the builder struct (#​145)

  • Add #[builder(finish_fn(vis = "...", doc { ... } ))] that allows overriding the visibility and docs of the finishing function (#​145)

  • Add #[builder(start_fn(doc { ... }))] that allows overriding the docs of the starting function (#​145)

  • Add #[builder(with = closure)] syntax to customize setters with a closure. If the closure returns a Result<_, E> the setters become fallible (#​145)

  • Add #[builder(with = Some)], #[builder(with = FromIterator::from_iter)], #[builder(with = <_>::from_iter)] syntax support for two well-known functions that will probably be used frequently (#​157)

  • Add #[builder(required)] for Option fields to opt out from their special handling which makes bon treat them as regular required fields. It's also available at the top-level via #[builder(on(_, required))] (#​145, #​155)

  • Add #[builder(crate = path::to::bon)] and #[bon(crate = path::to::bon)] to allow overriding the path to bon crate used in the generated code, which is useful for the cases when bon macros are wrapped by other macros (#​153)

  • Add #[builder(state_mod)] to configure the builder's type state API module name, visibility and docs (#​145)

  • 🔬 Experimental. Add #[builder(overwritable)] and #[builder(on(..., overwritable)] to make it possible to call setters multiple times for the same member. This attribute is available under the cargo feature "experimental-overwritable". The fate of this feature depends on your feedback in the tracking issue #​149. Please, let us know if you have a use case for this attribute! (#​145)

  • Add #[builder(setters)] to fine-tune the setters names, visibility and docs (#​145)

  • Add #[builder(derive(Clone/Debug(bounds(...))] to allow overriding trait bounds on the Clone/Debug impl block of the builder (#​145)

  • Add inheritance of #[allow()] and #[expect()] lint attributes to all generated items. This is useful to suppress any lints coming from the generated code. Although, lints coming from the generated code are generally considered defects in bon and should be reported via a Github issue, but this provides an easy temporary workaround for the problem (#​145)

Fixed
  • Fix false-positive unused_mut lints coming from #[builder] on a method that takes mut self (#​197)
  • Fix #[cfg/cfg_attr()] not being expanded when used on function arguments with doc comments or other attributes (#​145)
  • Fix raw identifiers in optional/default members (#​175)
Other
  • Add graceful internal panic handling. If some bon macro panics due to an internal bug, the macro will try to generate a fallback for IDEs to still provide intellisense (#​145)
  • Switch from elastio.github.io/bon to a custom domain bon-rs.com (#​158)
  • Add anonymous stats with umami for the docs website (#​158)
Docs

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [bon](https://bon-rs.com) ([source](https://github.com/elastio/bon)) | dependencies | major | `2.3.0` -> `3.0.0` | --- > ⚠️ **Warning** > > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>elastio/bon (bon)</summary> ### [`v3.7.1`](https://github.com/elastio/bon/releases/tag/v3.7.1) [Compare Source](https://github.com/elastio/bon/compare/v3.7.0...v3.7.1) This is a small patch release to make `bon` easier to package for Debian. ##### Other - Add Copyright header to the MIT License ([#&#8203;331](https://github.com/elastio/bon/pull/331)) ##### Internal - Fix MSRV tests and lints from nightly 13-08-2025 ([#&#8203;329](https://github.com/elastio/bon/pull/329)) - Revert refactoring PR 320 to make code compatible with darling 0.20 ([#&#8203;332](https://github.com/elastio/bon/pull/332)) ### [`v3.7.0`](https://github.com/elastio/bon/releases/tag/v3.7.0) [Compare Source](https://github.com/elastio/bon/compare/v3.6.5...v3.7.0) ##### Added - Add support for [`#[builder(derive(IntoFuture(Box)))]`](https://bon-rs.com/reference/builder/top-level/derive#intofuture-derive) ([#&#8203;322](https://github.com/elastio/bon/pull/322)). This allows calling `builder.await` instead of `builder.call().await`. Thanks [@&#8203;jakubadamw](https://github.com/jakubadamw) for the contribution! ##### Fixed - Add missing `where` clause forwarding to `#[builder(derive(Into))]` ([#&#8203;325](https://github.com/elastio/bon/pull/325)) ##### Internal - Make tests pass without the `experimental-overwritable` feature ([#&#8203;326](https://github.com/elastio/bon/pull/326)) - Sunset financial support by Kindness ([#&#8203;324](https://github.com/elastio/bon/pull/324)) - Fix clippy lints from nightly (2025-08-09) ([#&#8203;323](https://github.com/elastio/bon/pull/323)) ### [`v3.6.5`](https://github.com/elastio/bon/releases/tag/v3.6.5) [Compare Source](https://github.com/elastio/bon/compare/v3.6.4...v3.6.5) This is a regular maintenance release with no essential API/behavior changes. Enjoy the stability 😄. ##### Docs - Add all 3 variations of builder syntax to the Basics guide pages ([#&#8203;315](https://github.com/elastio/bon/pull/315)) ##### Internal - Update the dependency [`darling`](https://docs.rs/darling/latest/darling/) (crate for parsing the attributes) from `0.20` to `0.21` and other internal dependencies ([#&#8203;317](https://github.com/elastio/bon/pull/317), [#&#8203;320](https://github.com/elastio/bon/pull/320), [#&#8203;304](https://github.com/elastio/bon/pull/304)) - Switch from [`iai`](https://github.com/bheisler/iai) to [`iai-callgrind`](https://github.com/iai-callgrind/iai-callgrind) for high-precision benchmarking of `bon` ([#&#8203;311](https://github.com/elastio/bon/pull/311)). `iai-callgrind` is a better maintained alternative to `iai`, but in any case, both deserve a huge thanks for providing the benchmarking capabilities for `bon`! - Migrate to OIDC for [trusted publishing](https://crates.io/docs/trusted-publishing). Huge thanks for this new crates.io feature to everyone who made it happen! ([#&#8203;318](https://github.com/elastio/bon/pull/318)) - Fix `clippy::or_fun_call` lint from the nightly toolchain ([#&#8203;316](https://github.com/elastio/bon/pull/316)) ### [`v3.6.4`](https://github.com/elastio/bon/releases/tag/v3.6.4) [Compare Source](https://github.com/elastio/bon/compare/v3.6.3...v3.6.4) ##### Added - Improve error reporting when using the `#[bon::builder]` fully qualified attribute inside of impl blocks ([#&#8203;297](https://github.com/elastio/bon/pull/297)) ### [`v3.6.3`](https://github.com/elastio/bon/releases/tag/v3.6.3) [Compare Source](https://github.com/elastio/bon/compare/v3.6.2...v3.6.3) ##### Fixed - Fix missing support for `#[builder(field)]` with `#[builder(const)]` ([#&#8203;291](https://github.com/elastio/bon/pull/291)) ### [`v3.6.2`](https://github.com/elastio/bon/releases/tag/v3.6.2) [Compare Source](https://github.com/elastio/bon/compare/v3.6.1...v3.6.2) ##### Added - Propagate `#[target_feature]` attributes on `#[builder]`-generated finishing functions ([#&#8203;284](https://github.com/elastio/bon/pull/284)). Thanks [@&#8203;Lilyyy411](https://github.com/lilyyy411) for the contribution! ##### Fixed - Fix visibility and `const` token order in code generated by `#[builder(const)]` ([#&#8203;288](https://github.com/elastio/bon/pull/288)) ### [`v3.6.1`](https://github.com/elastio/bon/releases/tag/v3.6.1) [Compare Source](https://github.com/elastio/bon/compare/v3.6.0...v3.6.1) ##### Fixed - Propagate `#[track_caller]` to the generated finishing function from the underlying function/method ([#&#8203;282](https://github.com/elastio/bon/pull/282)). Thanks [@&#8203;Lilyyy411](https://github.com/lilyyy411) for the contribution! ### [`v3.6.0`](https://github.com/elastio/bon/releases/tag/v3.6.0) [Compare Source](https://github.com/elastio/bon/compare/v3.5.2...v3.6.0) ##### Added - Add very limited support for `#[builder(const)]` ([#&#8203;279](https://github.com/elastio/bon/pull/279)). See the updated docs [here](https://bon-rs.com/reference/builder/top-level/const) ### [`v3.5.2`](https://github.com/elastio/bon/releases/tag/v3.5.2) [Compare Source](https://github.com/elastio/bon/compare/v3.5.1...v3.5.2) ##### Fixed - Small fix for rust-analyzer syntax highlighting of parameters for functions annotated with `#[builder]` ([#&#8203;275](https://github.com/elastio/bon/pull/275)). This doesn't fix the problem fully since function parameters are now assigned "variable" semantic token type instead of "parameter". However, it's already better than "struct" that they were assigned before this fix. Created an issue in rust-analyzer with more details and to get the full fix of this problem: [rust-lang/rust-analyzer#19556](https://github.com/rust-lang/rust-analyzer/issues/19556). - Fix lints on nightly 2025-03-20 ([#&#8203;272](https://github.com/elastio/bon/pull/272)) ### [`v3.5.1`](https://github.com/elastio/bon/releases/tag/v3.5.1) [Compare Source](https://github.com/elastio/bon/compare/v3.5.0...v3.5.1) ##### Fixed - Delay the privatizing (i.e. renaming of the original function to `__orig_{fn_name}`) until after all other macros are expanded ([#&#8203;269](https://github.com/elastio/bon/pull/269)). Also removed the warnings for `#[tracing::instrument]` users introduced in [#&#8203;264](https://github.com/elastio/bon/pull/264). This is because with this patch there will be no difference whether you place `#[tracing::instrument]` after or before the `#[builder]` attribute - all other proc macros on the function will see the original function name. ### [`v3.5.0`](https://github.com/elastio/bon/releases/tag/v3.5.0) [Compare Source](https://github.com/elastio/bon/compare/v3.4.0...v3.5.0) ##### Added - Introduce `setters(doc(default(skip)))` attribute to skip the inclusion of the default value in the generated docs for setters ([#&#8203;265](https://github.com/elastio/bon/pull/265)). See the updated docs [here](https://bon-rs.com/reference/builder/member/setters#doc-default-skip). ##### Fixed - Trigger a compiler warning if `#[tracing::instrument]` is placed after the `#[builder]` instead of before ([#&#8203;264](https://github.com/elastio/bon/pull/264)). This should prevent the papercut where `tracing::instrument` assigns the span name with the ugly `__orig_` prefix in the name. - Fix repeated `#[builder]` attributes getting ignored on free functions ([#&#8203;263](https://github.com/elastio/bon/pull/263)) ### [`v3.4.0`](https://github.com/elastio/bon/releases/tag/v3.4.0) [Compare Source](https://github.com/elastio/bon/compare/v3.3.2...v3.4.0) ##### Added - Stabilize the current [`#[builder(getter)]`](https://bon-rs.com/reference/builder/member/getter) attribute MVP ([#&#8203;251](https://github.com/elastio/bon/pull/251)). The cargo feature `experimental-getters` is no longer needed and is now no-op. - Make `self` receiver and `start_fn` members available as official fields on the builder ([#&#8203;250](https://github.com/elastio/bon/pull/250)). Check the new documentation page about [native fields](https://bon-rs.com/guide/typestate-api/builder-fields#native-fields). - Introduce `#[builder(derive(Into))]` attribute to generate an `impl From<Builder> for T` ([#&#8203;248](https://github.com/elastio/bon/pull/248)). See the updated "Inspecting" guide page now known as [Derives for Builders](https://bon-rs.com/guide/basics/derives-for-builders) and the updated [`#[builder(derive)]` reference](https://bon-rs.com/reference/builder/top-level/derive). ##### Other - Fix a typo on the front page of the website 😳 ([#&#8203;243](https://github.com/elastio/bon/pull/243)). Thanks [@&#8203;MegaRedHand](https://github.com/MegaRedHand) for the contribution! - Add OpenCollective funding option ([#&#8203;241](https://github.com/elastio/bon/pull/241)) - Regular maintenance ([#&#8203;244](https://github.com/elastio/bon/pull/244), [#&#8203;246](https://github.com/elastio/bon/pull/246), [#&#8203;249](https://github.com/elastio/bon/pull/249), [#&#8203;253](https://github.com/elastio/bon/pull/253)) ##### Acknowledgements - Gratitude to the [*Kindness.ai*](https://kindness.ai/) team who started supporting on [OpenCollective](https://opencollective.com/bon-rs) at `100$` a month! - Gratitude to *Ethan Skowronski* who started supporting on [Patreon](https://www.patreon.com/c/Veetaha) at `1$` a month! ### [`v3.3.2`](https://github.com/elastio/bon/releases/tag/v3.3.2) [Compare Source](https://github.com/elastio/bon/compare/v3.3.1...v3.3.2) ##### Fixed - Fix syntax errors caused by PascalCasification when generating code for members named `self_` ([#&#8203;238](https://github.com/elastio/bon/pull/238)) ### [`v3.3.1`](https://github.com/elastio/bon/releases/tag/v3.3.1) [Compare Source](https://github.com/elastio/bon/compare/v3.3.0...v3.3.1) ##### Fixed - Fix `clippy::empty_enum` triggering on nightly with `feature(never_type)` enabled ([#&#8203;234](https://github.com/elastio/bon/pull/234)) ### [`v3.3.0`](https://github.com/elastio/bon/releases/tag/v3.3.0) [Compare Source](https://github.com/elastio/bon/compare/v3.2.0...v3.3.0) ##### Added - Add `clone`, `copy`, `deref` configs support in `#[builder(getter)]` ([see new docs](https://bon-rs.com/reference/builder/member/getter#overriding-the-return-type)) ([#&#8203;229](https://github.com/elastio/bon/pull/229)) ### [`v3.2.0`](https://github.com/elastio/bon/releases/tag/v3.2.0) [Compare Source](https://github.com/elastio/bon/compare/v3.1.1...v3.2.0) ##### Added - Add `#[builder(getter(...))]` attribute to define getters for already set members. See [Getters](https://bon-rs.com/guide/typestate-api/getters) guide for details ([#&#8203;222](https://github.com/elastio/bon/pull/222)) ([#&#8203;226](https://github.com/elastio/bon/pull/226)). Thanks [@&#8203;lazkindness](https://github.com/lazkindness) for the contribution! ### [`v3.1.1`](https://github.com/elastio/bon/releases/tag/v3.1.1) [Compare Source](https://github.com/elastio/bon/compare/v3.1.0...v3.1.1) ##### Fixed - Make generated identifiers of private fields deterministic. This is important for the [Buck](https://github.com/facebook/buck2) build system and probably for [Bazel](https://bazel.build/) as well ([#&#8203;219](https://github.com/elastio/bon/pull/219)) ### [`v3.1.0`](https://github.com/elastio/bon/releases/tag/v3.1.0) [Compare Source](https://github.com/elastio/bon/compare/v3.0.2...v3.1.0) ##### Added - Add [`#[builder(field)]`](https://bon-rs.com/reference/builder/member/field) to define custom private fields on the builder type. See [Custom Fields](https://bon-rs.com/guide/typestate-api/custom-fields) guide for details ([#&#8203;207](https://github.com/elastio/bon/pull/207)) ##### Other - Internal refactoring of naming in `bon`s test suite ([#&#8203;215](https://github.com/elastio/bon/pull/215)) ### [`v3.0.2`](https://github.com/elastio/bon/releases/tag/v3.0.2) [Compare Source](https://github.com/elastio/bon/compare/v3.0.1...v3.0.2) ##### Fixed - Fix `unexpected_cfgs` lint coming from `#[cfg(rust_analyzer)]` on the latest nightly ([#&#8203;212](https://github.com/elastio/bon/pull/212)) ### [`v3.0.1`](https://github.com/elastio/bon/releases/tag/v3.0.1) [Compare Source](https://github.com/elastio/bon/compare/v3.0.0...v3.0.1) ##### Fixed - Fix handling of lifetimes not used in fn param types ([#&#8203;208](https://github.com/elastio/bon/pull/208)) ### [`v3.0.0`](https://github.com/elastio/bon/releases/tag/v3.0.0) [Compare Source](https://github.com/elastio/bon/compare/v2.3.0...v3.0.0) See the most interesting changes described in [**Bon 3.0 Release blog post**](https://bon-rs.com/blog/bon-v3-release). All the breaking changes are very unlikely to actually break your code that was written against the `v2` version of `bon`. 99% of users should be able to update without any migration. ##### Changed - 🎉🎉 Stabilize the builder's [typestate API](https://bon-rs.com/guide/typestate-api) allowing for custom builder extensions. This is the **main theme** of this release. This new API brings the flexibility to a whole new level 🚀 🚀 ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Improve rustdoc output. See the rustoc examples and comparison in the [Alternatives](https://bon-rs.com/guide/alternatives#generated-docs-comparison) section ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add info that the member is required or optional. - For members with default values show the default value in the docs. - For optional members provide links to `{member}(T)` and `maybe_{member}(Option<T>)` setters. - Remove `__` prefixes for generic types and lifetimes from internal symbols. Instead, the prefixes added only if the macro detects a name collision. - ⚠️ **Breaking.** Reject unnecessary empty attributes e.g. `#[builder()]` or `#[builder]` with no parameters on a member ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - ⚠️ **Breaking.** Reject square brackets and curly braces delimiters for `builder_type`, `finish_fn`, `start_fn` and `on` attributes syntax. Only parentheses are accepted e.g. `#[builder(finish_fn(...))]` or `#[builder(on(...))]`. This no longer works: `#[builder(finish_fn[...])]` or `#[builder(on{...})]` ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - ⚠️ **Breaking.** Reject non-consecutive `on(...)` clauses. For example, the following now generates a compile error: `#[builder(on(String, into), finish_fn = build, on(Vec<_>, into))]`, because there is a `finish_fn = ...` between `on(...)` clauses. ([#&#8203;155](https://github.com/elastio/bon/pull/155)) - ⚠️ **Breaking.** `#[builder(derive(Clone, Debug))]` now generates impl blocks that follow the behaviour of standard `Clone` and `Debug` derives in that it conservatively adds `Clone/Debug` trait bounds for all the generic types declared on the original item (struct or function). Previously no additional bounds were required on `Clone` and `Debug` impls. See the *Added* section for details on the way to override these bounds with `#[builder(derive(Clone/Debug(bounds(...))))]` ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - ⚠️ **Breaking.** The name of the builder struct generated for methods named `builder` changed from `TBuilderBuilder` to just `TBuilder` making methods named `builder` work the same as methods named `new`. ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - ⚠️ **Breaking.** The type of the builder is now dependent on the order of the setters' invocation. This may only break code like the following: ```rust ignore let builder = if condition { Foo::builder().a(1).b(2) } else { Foo::builder().b(1).a(2) }; builder.build(); ``` This is because the types of the builders returned from the branches are the following: - `FooBuilder<SetB<SetA>>` (`if` branch) - `FooBuilder<SetA<SetB>>` (`else` branch) We believe such code should generally be very rare and even if it breaks, it's easy to fix it by reordering the setter method calls. This compromise was accepted as a design tradeoff such that the builder's type signature becomes simpler, the generated documentation becomes much less noisy, it removes an annoying special case for the builder of just one member, and it improves the type-checking performance considerably compared to the previous approach that used tuples to represent the type state. ([#&#8203;145](https://github.com/elastio/bon/pull/145)) ##### Removed - ⚠️ **Breaking.** Remove support for `#[bon::builder]` proc-macro attribute on top of a `struct`. Use `#[derive(bon::Builder)]` for that instead. This syntax has been deprecated since `2.1` and it is now removed as part of a major version cleanup ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - ⚠️ **Breaking.** Remove `#[builder(expose_positional_fn = positional_fn_name)]` attribute. Use [`#[builder(start_fn = builder_fn_name)]`](https://bon-rs.com/reference/builder/top-level/start_fn) instead, since this attribute works additively keeping the function with positional arguments under the attribute unchanged. ([#&#8203;153](https://github.com/elastio/bon/pull/153)) ##### Added - ⚠️ **Breaking.** Builder macros now generate additional `mod builder_name {}` where `builder_name` is the snake_case version of the name of the builder struct. This new module contains the type state API of the builder. There is a low probability that this new module name may conflict with existing symbols in your scope, so this change is marked as breaking ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(builder_type(vis = "...", doc { ... }))]`](https://bon-rs.com/reference/builder/top-level/builder_type) that allows overriding the visibility and docs of the builder struct ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(finish_fn(vis = "...", doc { ... } ))]`](https://bon-rs.com/reference/builder/top-level/finish_fn) that allows overriding the visibility and docs of the finishing function ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(start_fn(doc { ... }))]`](https://bon-rs.com/reference/builder/top-level/start_fn) that allows overriding the docs of the starting function ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(with = closure)]`](https://bon-rs.com/reference/builder/member/with) syntax to customize setters with a closure. If the closure returns a `Result<_, E>` the setters become fallible ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add `#[builder(with = Some)]`, `#[builder(with = FromIterator::from_iter)]`, `#[builder(with = <_>::from_iter)]` syntax support for two [well-known functions](https://bon-rs.com/reference/builder/member/with#well-known-functions) that will probably be used frequently ([#&#8203;157](https://github.com/elastio/bon/pull/157)) - Add [`#[builder(required)]`](https://bon-rs.com/reference/builder/member/required) for `Option` fields to opt out from their special handling which makes `bon` treat them as regular required fields. It's also available at the top-level via `#[builder(on(_, required))]` ([#&#8203;145](https://github.com/elastio/bon/pull/145), [#&#8203;155](https://github.com/elastio/bon/pull/155)) - Add [`#[builder(crate = path::to::bon)]`](https://bon-rs.com/reference/builder/top-level/crate) and `#[bon(crate = path::to::bon)]` to allow overriding the path to `bon` crate used in the generated code, which is useful for the cases when `bon` macros are wrapped by other macros ([#&#8203;153](https://github.com/elastio/bon/pull/153)) - Add [`#[builder(state_mod)]`](https://bon-rs.com/reference/builder/top-level/state_mod) to configure the builder's type state API module name, visibility and docs ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - 🔬 **Experimental.** Add [`#[builder(overwritable)]`](https://bon-rs.com/reference/builder/member/overwritable) and `#[builder(on(..., overwritable)]` to make it possible to call setters multiple times for the same member. This attribute is available under the cargo feature `"experimental-overwritable"`. The fate of this feature depends on your feedback in the tracking issue [#&#8203;149](https://github.com/elastio/bon/issues/149). Please, let us know if you have a use case for this attribute! ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(setters)]`](https://bon-rs.com/reference/builder/member/setters) to fine-tune the setters names, visibility and docs ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add [`#[builder(derive(Clone/Debug(bounds(...))]`](https://bon-rs.com/reference/builder/top-level/derive#generic-types-handling) to allow overriding trait bounds on the `Clone/Debug` impl block of the builder ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Add inheritance of `#[allow()]` and `#[expect()]` lint attributes to all generated items. This is useful to suppress any lints coming from the generated code. Although, lints coming from the generated code are generally considered defects in `bon` and should be reported via a Github issue, but this provides an easy temporary workaround for the problem ([#&#8203;145](https://github.com/elastio/bon/pull/145)) ##### Fixed - Fix false-positive `unused_mut` lints coming from `#[builder]` on a method that takes `mut self` ([#&#8203;197](https://github.com/elastio/bon/pull/197)) - Fix `#[cfg/cfg_attr()]` not being expanded when used on function arguments with doc comments or other attributes ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Fix raw identifiers in optional/default members ([#&#8203;175](https://github.com/elastio/bon/pull/175)) ##### Other - Add graceful internal panic handling. If some `bon` macro panics due to an internal bug, the macro will try to generate a fallback for IDEs to still provide intellisense ([#&#8203;145](https://github.com/elastio/bon/pull/145)) - Switch from `elastio.github.io/bon` to a custom domain `bon-rs.com` ([#&#8203;158](https://github.com/elastio/bon/pull/158)) - Add anonymous stats with [`umami`](https://umami.is/) for the docs website ([#&#8203;158](https://github.com/elastio/bon/pull/158)) ##### Docs - Refactor the README.md and all pages in the Guide Book by simplifying them and removing redundancies ([#&#8203;170](https://github.com/elastio/bon/pull/170)) - Add new pages to the Guide Book: - [Custom Conversions](https://bon-rs.com/guide/basics/custom-conversions) ([#&#8203;170](https://github.com/elastio/bon/pull/170)) - [Typestate API](https://bon-rs.com/guide/typestate-api) ([#&#8203;170](https://github.com/elastio/bon/pull/170)) - [Builder's Type Signature](https://bon-rs.com/guide/typestate-api/builders-type-signature) ([#&#8203;170](https://github.com/elastio/bon/pull/170)) - [Custom Methods](https://bon-rs.com/guide/typestate-api/custom-methods) ([#&#8203;171](https://github.com/elastio/bon/pull/171)) - [Optional Generic Members](https://bon-rs.com/guide/patterns/optional-generic-members) ([#&#8203;173](https://github.com/elastio/bon/pull/173)) - [Compilation Benchmarks](https://bon-rs.com/guide/benchmarks/compilation) ([#&#8203;177](https://github.com/elastio/bon/pull/177)) - Split API reference into multiple pages. The [root page](https://bon-rs.com/reference/builder) now contains a convenient table with short descriptions of all available configuration attributes ([#&#8203;164](https://github.com/elastio/bon/pull/164)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI2NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->
renovate added the
dependencies
renovate
labels 2025-08-01 13:25:05 +10:00
renovate added 1 commit 2025-08-01 13:25:06 +10:00
fix(deps): update rust crate bon to v3
All checks were successful
Build and test / Tests (pull_request) Successful in 55s
Build and test / Clippy (pull_request) Successful in 44s
Checking yaml / Run yamllint (pull_request) Successful in 23s
Checking Renovate configuration / validate (pull_request) Successful in 1m15s
Build and test / Build AMD64 (pull_request) Successful in 1m10s
Build and test / Generate Documentation (pull_request) Successful in 1m24s
4b1ca3296b
kernald was assigned by renovate 2025-08-01 13:25:07 +10:00
renovate force-pushed renovate/bon-3.x from 4b1ca3296b to 8938feaefa 2025-08-01 14:14:33 +10:00 Compare
renovate force-pushed renovate/bon-3.x from 8938feaefa to 37b93750bd 2025-08-01 15:32:18 +10:00 Compare
renovate force-pushed renovate/bon-3.x from 37b93750bd to 336d7e51b7 2025-08-14 11:01:34 +10:00 Compare
renovate force-pushed renovate/bon-3.x from 336d7e51b7 to a936d5814c 2025-08-16 20:02:52 +10:00 Compare
All checks were successful
Build and test / Build AMD64 (pull_request) Successful in 1m30s
Required
Details
Build and test / Generate Documentation (pull_request) Successful in 1m36s
Required
Details
Checking Renovate configuration / validate (pull_request) Successful in 1m20s
Required
Details
Build and test / Tests (pull_request) Successful in 1m18s
Required
Details
Checking yaml / Run yamllint (pull_request) Successful in 5s
Required
Details
Build and test / Clippy (pull_request) Successful in 50s
Required
Details
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/bon-3.x:renovate/bon-3.x
git checkout renovate/bon-3.x
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kernald/immich-tools#51
No description provided.