NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #414 most downloaded on crates.io
Internal implementation of `derive_more` crate
Last release 9 months ago
22 Dec 2025
Release timing varies
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 5 of 5 stable releases
2 versions withdrawn
withdrawn after publishing
3 years old
12 releases · first in 2023
One column per quarter.
API docs Changelog
.as_dyn_error() method hygiene inside Error derive expansion.
(#527)Suppress deprecation warnings in generated code.
#[display(rename_all = "<casing>")] attribute to change output for implicit naming of unit enum variants or unit structs when deriving Display. (#443)#[from_str(rename_all = "<casing>")] attribute for unit enum variants and unit structs when deriving FromStr. (#467)Option fields for Error::source() in Error derive. (#459)FromStr derive. (#469)PartialEq derive similar to std's one, but considering generics correctly, and implementing ne() method as well. (#473, #475)Eq derive similar to std's one, but considering generics correctly. (#479)#[allow]/#[expect] attributes of the type in Constructor derive. (#477)Deref and DerefMut derives for enums. (#485)FromStr derive. (#494)TryInto derive. (#503)Add-like, AddAssign-like, Mul-like and MulAssign-like derives. (#472)Add-like, AddAssign-like, Mul-like and MulAssign-like derives now infer trait bounds for generics structurally (bound field types instead of type parameters directly). (#472)#[try_from(repr)] attribute is not specified for TryFrom derive. (#458)AsRef/AsMut derives when associative types are involved. (#474)Try/TryInto derives when Self type is present in the struct or enum definition. (#489)feature(error_generic_member_access) in Error derive when using Backtrace on a non-nightly toolchain. (#513)#[<display-trait>("default formatting")] attribute without {_variant} being used as default for enum variants without explicit formatting. (#495)Full Changelog: v2.0.1...v2.1.0
API docs Changelog
use derive_more::SomeTrait now imports macro only. Importing macro with its trait along is possible now via use derive_more::with_trait::SomeTrait .
use derive_more::SomeTrait now imports macro only. Importing macro with its trait along is possible now via use derive_more::with_trait::SomeTrait. (#406)#[display("...")] attribute on an enum now has defaulting behavior instead of replacing when no wrapping is possible (no _variant placeholder). (#395)Debug and Display expansions. (#399)unreachable_code warnings on generated code when ! (never type) is used. (#404)TryFrom, TryInto or FromStr with an associated item called Error or Err respectively. (#410)#[display("...")] attribute on an enum being incorrectly treatedDebug and Display expansions. (#431)Debug expansions. (#431)#[display("...")] attribute on an enum not working transparently for directly specified fields. (#438)Debug and Display expansions. (#440)Full Changelog: v1.0.0...v2.0.0
derive_more is a library that adds derives for many of the standard library traits. By using this library the following code just works:
derive_more is a library that adds derives for many of the standard library traits. By using this library the following code just works:
use derive_more::{Add, Display, From, Into};
#[derive(PartialEq, From, Add)]
struct MyInt(i32);
#[derive(PartialEq, From, Into)]
struct Point2D {
x: i32,
y: i32,
}
#[derive(PartialEq, From, Add, Display)]
enum MyEnum {
#[display("int: {_0}")]
Int(i32),
Uint(u32),
#[display("nothing")]
Nothing,
}
assert!(MyInt(11) == MyInt(5) + 6.into());
assert!((5, 6) == Point2D { x: 5, y: 6 }.into());
assert!(MyEnum::Int(15) == (MyEnum::Int(8) + 7.into()).unwrap());
assert!(MyEnum::Int(15).to_string() == "int: 15");
assert!(MyEnum::Uint(42).to_string() == "42");
assert!(MyEnum::Nothing.to_string() == "nothing");Now, 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:
Debug derive that can be used to easily customize Debug formatting.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).Error when an error occurs instead of a &'static str.use derive_more::SomeTrait the actual trait is also imported not just the derive macro. This is especially useful for Error andDisplaystd feature which should be disabled in no_std environments.std, are now disabled by default. The full feature can be used to get the old behavior of supporting all possible derives.TryFrom, Add, Sub, BitAnd, BitOr, BitXor, Not and Neg derives now return a dedicated error type instead of a &'static str on error.FromStr derive now uses a dedicated FromStrError error type instead of generating unique one each time.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.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)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.From derive doesn't derive From<()> for enum variants without any fields anymore. This feature was removed because it was considered useless in practice.From derive now uses #[from(<types>)] instead of #[from(types(<types>))] and ignores field type itself.Into derive now uses #[into(<types>)] instead of #[into(types(<types>))] and ignores field type itself.Into derive now generates separate impls for each field whenever the #[into(...)] attribute is applied to it. (#291)Error derive is updated with changes to the error_generic_member_access unstable feature for nightly users. (#200, #294)as_mut feature is removed, and the AsMut derive is now gated by the as_ref feature. (#295)#[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)Display derives. So now you can use: #[display(fmt = "Prefix: {field}")] instead of needing to use #[display(fmt = "Prefix: {}", field)]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.#[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)TryUnwrap derive similar to the Unwrap derive. This one returns a Result and does not panic. (#206)Debug derive with the same syntax as Display derives. (#279)derive_more::derive module exporting only macros, without traits. (#290)AsRef/AsMut derives. (#298)TryFrom derive for enums to convert from their discriminant. (#300)#[inline] attributes to IsVariant and Debug implementations. (#334#[track_caller] to Add, Mul, AddAssign and MulAssign derives (#378Constructor and IsVariant derives now generate const fn functions.IsVariant are now marked #[must_use]. (#350)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.syn 2.0.Error derive now works in nightly no_std environmentsHashSet in all derives, this is needed for rust analyzer to work correctly.Provider API for backtraces in Error derive.Error derive not working with const generics.Box<dyn Error + Send + 'static>IntoIterator impls for generic structs. (#284)Display derive. (#297)core crate. (#327)IsVariant derive.{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)Full Changelog: v0.99.18...v1.0.0
API docs Changelog
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →