fix(deps): update rust crate derive_more to v1 #95

Open
renovate-bot wants to merge 1 commit from renovate/derive_more-1.x into master
Member

This PR contains the following updates:

Package Type Update Change
derive_more dependencies major 0.99 -> 1.0

Release Notes

JelteF/derive_more (derive_more)

v1.0.0

Compare Source

More than 8 years after the first commit and almost 5 years after the 0.99.0
release, derive_more has finally reached its 1.0.0 release. This release
contains a lot of changes (including some breaking ones) to make it easier to
use the derives and make it possible to extend them without having to break
backwards compatibility again. There are five major changes that I would like
to call out, but there are many more changes that are documented below:

  1. There is a new Debug derive that can be used to easily customize Debug
    formatting.
  2. A greatly improved Display derive, which allows you to do anything that
    thiserror provides, but it works
    for any type not just errors. And by combining the Display derive with the
    Error and From derives, there shouldn't really be any need to use
    thiserror anymore (if you are missing a feature/behaviour from thiserror
    please report an issue).
  3. Traits that can return errors now return a type that implements Error
    when an error occurs instead of a &'static str.
  4. When using use derive_more::SomeTrait the actual trait is also imported
    not just the derive macro. This is especially useful for Error and
    Display
  5. The docs are now rendered on docs.rs and are much better overall.
Breaking changes
  • The minimum supported Rust version (MSRV) is now Rust 1.75.
  • Add the std feature which should be disabled in no_std environments.
  • All Cargo features, except std, are now disabled by default. The full
    feature can be used to get the old behavior of supporting all possible
    derives.
  • The TryFrom, Add, Sub, BitAnd, BitOr, BitXor, Not and Neg
    derives now return a dedicated error type instead of a &'static str on
    error.
  • The FromStr derive now uses a dedicated FromStrError error type instead
    of generating unique one each time.
  • The Display derive (and other fmt-like ones) now uses
    #[display("...", (<expr>),*)] syntax instead of
    #[display(fmt = "...", ("<expr>"),*)], and #[display(bound(<bound>))]
    instead of #[display(bound = "<bound>")]. So without the double quotes
    around the expressions and bounds.
  • The Debug and Display derives (and other fmt-like ones) now transparently
    delegate to the inner type when #[display("...", (<expr>),*)] attribute is
    trivially substitutable with a transparent call.
    (#​322)
  • The DebugCustom derive is renamed to just Debug (gated now under a separate
    debug feature), and its semantics were changed to be a superset of std variant
    of Debug.
  • The From derive doesn't derive From<()> for enum variants without any
    fields anymore. This feature was removed because it was considered useless in
    practice.
  • The From derive now uses #[from(<types>)] instead of #[from(types(<types>))]
    and ignores field type itself.
  • The Into derive now uses #[into(<types>)] instead of #[into(types(<types>))]
    and ignores field type itself.
  • The Into derive now generates separate impls for each field whenever the #[into(...)]
    attribute is applied to it. (#​291)
  • Importing a derive macro now also imports its corresponding trait.
  • The Error derive is updated with changes to the error_generic_member_access
    unstable feature for nightly users. (#​200,
    #​294)
  • The as_mut feature is removed, and the AsMut derive is now gated by the
    as_ref feature. (#​295)
  • A top level #[display("...")] attribute on an enum now requires the usage
    of {_variant} to include the variant instead of including it at {}. The
    reason is that {} now references the first argument to the format string,
    just like in all other format strings. (#​377)
Added
  • Add support captured identifiers in Display derives. So now you can use:
    #[display(fmt = "Prefix: {field}")] instead of needing to use
    #[display(fmt = "Prefix: {}", field)]
  • Add FromStr derive support for enums that contain variants without fields.
    If you pass the name of the variant to from_str it will create the matching
    variant.
  • Add #[unwrap(owned, ref, ref_mut)] attribute for the Unwrap derive.
    By using them, it is possible to derive implementations for the reference types as well.
    (#​206)
  • Add TryUnwrap derive similar to the Unwrap derive. This one returns a Result and does not panic.
    (#​206)
  • Add support for container format in Debug derive with the same syntax as Display derives.
    (#​279)
  • derive_more::derive module exporting only macros, without traits.
    (#​290)
  • Add support for specifying concrete types to AsRef/AsMut derives.
    (#​298)
  • Add TryFrom derive for enums to convert from their discriminant.
    (#​300)
  • #[inline] attributes to IsVariant and Debug implementations.
    (#​334
  • Add #[track_caller] to Add, Mul, AddAssign and MulAssign derives
    (#​378
Changed
  • The Constructor and IsVariant derives now generate const fn functions.
  • Static methods derived by IsVariant are now marked #[must_use].
    (#​350)
  • The Unwrap and IsVariant derives now generate doc comments.
  • #[automatically_derived] is now emitted from all macro expansions. This
    should prevent code style linters from attempting to modify the generated
    code.
  • Upgrade to syn 2.0.
  • The Error derive now works in nightly no_std environments
Fixed
  • Use a deterministic HashSet in all derives, this is needed for rust analyzer
    to work correctly.
  • Use Provider API for backtraces in Error derive.
  • Fix Error derive not working with const generics.
  • Support trait objects for source in Error, e.g.
    Box<dyn Error + Send + 'static>
  • Fix bounds on derived IntoIterator impls for generic structs.
    (#​284)
  • Fix documentation of generated bounds in Display derive.
    (#​297)
  • Hygiene of macro expansions in presence of custom core crate.
    (#​327)
  • Fix documentation of generated methods in IsVariant derive.
  • Make {field:p} do the expected thing in format strings for Display and
    Debug. Also document weirdness around Pointer formatting when using
    expressions, due to field variables being references.
    (#​381)

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 | |---|---|---|---| | [derive_more](https://github.com/JelteF/derive_more) | dependencies | major | `0.99` -> `1.0` | --- ### Release Notes <details> <summary>JelteF/derive_more (derive_more)</summary> ### [`v1.0.0`](https://github.com/JelteF/derive_more/blob/HEAD/CHANGELOG.md#100---2024-08-07) [Compare Source](https://github.com/JelteF/derive_more/compare/v0.99.18...v1.0.0) More than 8 years after the first commit and almost 5 years after the 0.99.0 release, `derive_more` has finally reached its 1.0.0 release. This release contains a lot of changes (including some breaking ones) to make it easier to use the derives and make it possible to extend them without having to break backwards compatibility again. There are five major changes that I would like to call out, but there are many more changes that are documented below: 1. There is a new `Debug` derive that can be used to easily customize `Debug` formatting. 2. A greatly improved `Display` derive, which allows you to do anything that [`thiserror`](https://github.com/dtolnay/thiserror) provides, but it works for any type not just errors. And by combining the `Display` derive with the `Error` and `From` derives, there shouldn't really be any need to use `thiserror` anymore (if you are missing a feature/behaviour from `thiserror` please report an issue). 3. Traits that can return errors now return a type that implements `Error` when an error occurs instead of a `&'static str`. 4. When using `use derive_more::SomeTrait` the actual trait is also imported not just the derive macro. This is especially useful for `Error` and `Display` 5. The docs are now rendered on docs.rs and are much better overall. ##### Breaking changes - The minimum supported Rust version (MSRV) is now Rust 1.75. - Add the `std` feature which should be disabled in `no_std` environments. - All Cargo features, except `std`, are now disabled by default. The `full` feature can be used to get the old behavior of supporting all possible derives. - The `TryFrom`, `Add`, `Sub`, `BitAnd`, `BitOr`, `BitXor`, `Not` and `Neg` derives now return a dedicated error type instead of a `&'static str` on error. - The `FromStr` derive now uses a dedicated `FromStrError` error type instead of generating unique one each time. - The `Display` derive (and other `fmt`-like ones) now uses `#[display("...", (<expr>),*)]` syntax instead of `#[display(fmt = "...", ("<expr>"),*)]`, and `#[display(bound(<bound>))]` instead of `#[display(bound = "<bound>")]`. So without the double quotes around the expressions and bounds. - The `Debug` and `Display` derives (and other `fmt`-like ones) now transparently delegate to the inner type when `#[display("...", (<expr>),*)]` attribute is trivially substitutable with a transparent call. ([#&#8203;322](https://github.com/JelteF/derive_more/pull/322)) - The `DebugCustom` derive is renamed to just `Debug` (gated now under a separate `debug` feature), and its semantics were changed to be a superset of `std` variant of `Debug`. - The `From` derive doesn't derive `From<()>` for enum variants without any fields anymore. This feature was removed because it was considered useless in practice. - The `From` derive now uses `#[from(<types>)]` instead of `#[from(types(<types>))]` and ignores field type itself. - The `Into` derive now uses `#[into(<types>)]` instead of `#[into(types(<types>))]` and ignores field type itself. - The `Into` derive now generates separate impls for each field whenever the `#[into(...)]` attribute is applied to it. ([#&#8203;291](https://github.com/JelteF/derive_more/pull/291)) - Importing a derive macro now also imports its corresponding trait. - The `Error` derive is updated with changes to the `error_generic_member_access` unstable feature for nightly users. ([#&#8203;200](https://github.com/JelteF/derive_more/pull/200), [#&#8203;294](https://github.com/JelteF/derive_more/pull/294)) - The `as_mut` feature is removed, and the `AsMut` derive is now gated by the `as_ref` feature. ([#&#8203;295](https://github.com/JelteF/derive_more/pull/295)) - A top level `#[display("...")]` attribute on an enum now requires the usage of `{_variant}` to include the variant instead of including it at `{}`. The reason is that `{}` now references the first argument to the format string, just like in all other format strings. ([#&#8203;377](https://github.com/JelteF/derive_more/pull/377)) ##### Added - Add support captured identifiers in `Display` derives. So now you can use: `#[display(fmt = "Prefix: {field}")]` instead of needing to use `#[display(fmt = "Prefix: {}", field)]` - Add `FromStr` derive support for enums that contain variants without fields. If you pass the name of the variant to `from_str` it will create the matching variant. - Add `#[unwrap(owned, ref, ref_mut)]` attribute for the `Unwrap` derive. By using them, it is possible to derive implementations for the reference types as well. ([#&#8203;206](https://github.com/JelteF/derive_more/pull/206)) - Add `TryUnwrap` derive similar to the `Unwrap` derive. This one returns a `Result` and does not panic. ([#&#8203;206](https://github.com/JelteF/derive_more/pull/206)) - Add support for container format in `Debug` derive with the same syntax as `Display` derives. ([#&#8203;279](https://github.com/JelteF/derive_more/pull/279)) - `derive_more::derive` module exporting only macros, without traits. ([#&#8203;290](https://github.com/JelteF/derive_more/pull/290)) - Add support for specifying concrete types to `AsRef`/`AsMut` derives. ([#&#8203;298](https://github.com/JelteF/derive_more/pull/298)) - Add `TryFrom` derive for enums to convert from their discriminant. ([#&#8203;300](https://github.com/JelteF/derive_more/pull/300)) - `#[inline]` attributes to `IsVariant` and `Debug` implementations. ([#&#8203;334](https://github.com/JelteF/derive_more/pull/334) - Add `#[track_caller]` to `Add`, `Mul`, `AddAssign` and `MulAssign` derives ([#&#8203;378](https://github.com/JelteF/derive_more/pull/378) ##### Changed - The `Constructor` and `IsVariant` derives now generate `const fn` functions. - Static methods derived by `IsVariant` are now marked `#[must_use]`. ([#&#8203;350](https://github.com/JelteF/derive_more/pull/350)) - The `Unwrap` and `IsVariant` derives now generate doc comments. - `#[automatically_derived]` is now emitted from all macro expansions. This should prevent code style linters from attempting to modify the generated code. - Upgrade to `syn` 2.0. - The `Error` derive now works in nightly `no_std` environments ##### Fixed - Use a deterministic `HashSet` in all derives, this is needed for rust analyzer to work correctly. - Use `Provider` API for backtraces in `Error` derive. - Fix `Error` derive not working with `const` generics. - Support trait objects for source in Error, e.g. `Box<dyn Error + Send + 'static>` - Fix bounds on derived `IntoIterator` impls for generic structs. ([#&#8203;284](https://github.com/JelteF/derive_more/pull/284)) - Fix documentation of generated bounds in `Display` derive. ([#&#8203;297](https://github.com/JelteF/derive_more/pull/297)) - Hygiene of macro expansions in presence of custom `core` crate. ([#&#8203;327](https://github.com/JelteF/derive_more/pull/327)) - Fix documentation of generated methods in `IsVariant` derive. - Make `{field:p}` do the expected thing in format strings for `Display` and `Debug`. Also document weirdness around `Pointer` formatting when using expressions, due to field variables being references. ([#&#8203;381](https://github.com/JelteF/derive_more/pull/381)) </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:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMS4yIiwidXBkYXRlZEluVmVyIjoiMzguMjMuMiIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJyZW5vdmF0ZS1ib3QiXX0=-->
renovate-bot added the
renovate-bot
label 2024-08-07 23:05:44 +05:30
renovate-bot added 1 commit 2024-08-07 23:05:44 +05:30
fix(deps): update rust crate derive_more to v1
Some checks failed
renovate/artifacts Artifact file update failure
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
6e5ba23ba2
Author
Member

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --package derive_more@0.99.18 --precise 1.0.0
    Updating crates.io index
error: failed to select a version for the requirement `derive_more = "^0.99.17"`
candidate versions found which didn't match: 1.0.0
location searched: crates.io index
required by package `argon2-creds v0.2.2 (https://github.com/realaravinth/argon2-creds?branch=master#9f43fd56)`
    ... which satisfies git dependency `argon2-creds` (locked to 0.2.2) of package `librepages v0.1.0 (/tmp/renovate-bot-cache/repos/gitea/LibrePages/librepages)`

### ⚠️ Artifact update problem Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens: - any of the package files in this branch needs updating, or - the branch becomes conflicted, or - you click the rebase/retry checkbox if found above, or - you rename this PR's title to start with "rebase!" to trigger it manually The artifact failure details are included below: ##### File name: Cargo.lock ``` Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --package derive_more@0.99.18 --precise 1.0.0 Updating crates.io index error: failed to select a version for the requirement `derive_more = "^0.99.17"` candidate versions found which didn't match: 1.0.0 location searched: crates.io index required by package `argon2-creds v0.2.2 (https://github.com/realaravinth/argon2-creds?branch=master#9f43fd56)` ... which satisfies git dependency `argon2-creds` (locked to 0.2.2) of package `librepages v0.1.0 (/tmp/renovate-bot-cache/repos/gitea/LibrePages/librepages)` ```
Some checks failed
renovate/artifacts Artifact file update failure
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
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/derive_more-1.x:renovate/derive_more-1.x
git checkout renovate/derive_more-1.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout master
git merge --no-ff renovate/derive_more-1.x
git checkout renovate/derive_more-1.x
git rebase master
git checkout master
git merge --ff-only renovate/derive_more-1.x
git checkout renovate/derive_more-1.x
git rebase master
git checkout master
git merge --no-ff renovate/derive_more-1.x
git checkout master
git merge --squash renovate/derive_more-1.x
git checkout master
git merge --ff-only renovate/derive_more-1.x
git checkout master
git merge renovate/derive_more-1.x
git push origin master
Sign in to join this conversation.
No description provided.